Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Data Prep for Tableau

l_blumberger
7 - Meteor

Hi there,

 

I am working with Alteryx and Tableau but having some difficulty figuring out how to filter my data the way I need. I am not able to post my workbook, so I have created example data below.

 

 
TypeStoreEmployee
Small1a
Small1b
Large2a
Large2c
Large2f
Large2h
Small3b
Small3f
Small3k
Large4c
Large4h

 

For this example, I have a bunch of stores that have various employees as shown in the table above. Some employees work at only one store and some work at multiple stores. There are two types of stores: large and small. So far, I have created two sheets. The first sheet is filtered by small stores, where there is a drop down menu with all small stores. Once a small store is selected all the employees that work at that store are listed. The second sheet does the exact same for all large stores.

 

What I need to happen on the Tableau dashboard: User chooses small store 1 in sheet 1 and large store 2 in sheet 2, then only the employees that work in store 1 and do not work in store 2 are listed in sheet 1, and all the employees that work in store 2 and do not work in store 1 are listed in sheet 2 (as shown in the table below).

 

 
 

Small Stores

(*store 1 selected from menu filter*)

Large Stores

(*store 2 selected from menu filter*)

bc
 f
 h

  

 

As I did for a similar use case, I feel like I may need to create some indicators in Alteryx for the cross referencing of employees to stores?

 

Any suggestions are appreciated! Thanks in advance for the help!

 

Lauren

8 REPLIES 8
michael_treadwell
ACE Emeritus
ACE Emeritus

Seems like you could do this pretty simply in Tableau without any extra logic in your Alteryx workflow.

 

Create two parameters: [StoreA] and [StoreB]

 

Then create two calculated fields: [InANotB] and [InANotB]

 

InANotB

[Store] == [StoreA] AND [Store] != [StoreB]

 

InBNotA

[Store] == [StoreB] AND [Store] != [StoreA]

 

Use InANotB for the first sheet and InBNotA for the second sheet.

 

NOTE: Edited because there are not only two stores

l_blumberger
7 - Meteor

I'm not sure how I would write a formula like [Store] == [StoreA] AND [Store] != [StoreB], when I have multiple stores that fall into two categories and each store has multiple employees...

michael_treadwell
ACE Emeritus
ACE Emeritus

I was able to accomplish this using the parameters and fields below. Not saying it is the best way but it is a way. I didn't place a [Type] filter on either sheet.

Create parameter StoreA with options for all 'Small' store numbers: (1, 3)

Create parameter StoreB with options for all 'Large' store numbers: (2, 4)

 

InA:

IF [Store] == [StoreA] THEN 1 ELSE 0 END

 

InB:

IF [Store] == [StoreB] THEN 1 ELSE 0 END

 

InA and NotInB:

SUM([InB]) == 0 AND SUM([InA]) == 1

 

InB and NotInA:

SUM([InB]) == 1 AND SUM([InA]) == 0

Joe_Mako
12 - Quasar

Attached is an Alteryx workflow and here is the result in Tableau Public:

https://public.tableau.com/views/storeemployee/Dashboard1

Is this what you are looking for?

 

Employee Store.png

 

The process gets the list of stores, and appends for all combinations Small-Large store combinations, appends that will the list of distinct employees, uses join multiples to bring in the small and large employees, and filters out the extra records.

 

Employee Store Tableau.png

 

In Tableau, the two sheets you select from are using your original data source, and with filter actions, selections impact the sheet below connected to the reshaped data. There are a couple of calc fields to filter and make a nice display.

 

If you have more than two store types, the workflow logic would need to be adjusted, but this works for any store and employee combinations. Additionally, if you want lother logic, like employes in both instead of in just one, that can be done by editing the calulated fields in Tableau.

l_blumberger
7 - Meteor

Thank you! I am relatively new to Tableau so I wasn't aware of how to apply the parameter in this case. It is working perfectly now. Thanks to all who responded with different ideas.

l_blumberger
7 - Meteor

Thanks again Michael for your response. When filtering by one store I do get the results I am looking for, however I would also like to be able to select multiple small stores and multiple large stores for comparison. Since there is no mutliple select options in parameters, do you know of any work around??

Joe_Mako
12 - Quasar

I changed the filter logic in the published Tableau workbook:
https://public.tableau.com/views/storeemployee/Dashboard1

 

With your sample data, if you select Store 3 in the Small type, and both Large stores, here is the result:

 

alt filter.png

 

It keeps Employees that are only in one Type of Store, either only Small or only Large.

 

Is this what you are looking for?

 

No change needed to the Alteryx workflow, the data structure created is very flexible because it is fully domain complete, and enables other sophisticated filtering logic with different filter formulas.

 

You are welcome to message me if you would like to setup a screen share to walk through the Alteryx workflow and Tableau workbook in greater detail together.

l_blumberger
7 - Meteor

Hi Joe. I actually didn't use your solution before, as I have about 9000 "employees" and didn't want to create such a large database if I didn't have to. Realizing now that I can not do a multi select with the parameters in Tableau, I am going back to Alteryx workflow. I will definitely message you if I run into difficulty. Thanks so much for the help!

Labels