Advertisement

How to create dynamic groups based on the user selection in Tableau

How to create dynamic groups based on the user selection in Tableau In this silent video you’ll learn how to create dynamic groups based on the user selection in Tableau.

For example, if the user selects sets a threshold sales amount in a parameter, than the all customers above that threshold should be shown by their names and all other customers should be grouped as "Others."


Read the full article here: Creating Dynamic "Others" Group based on User Selection —


- - - - - - - - - - - - - -
Option 1 - Create a calculated field
1. Click the down arrow next to Dimensions in the data pane and select Create Parameter…
2. In the Create Parameter dialog, do the following and click OK:
1. Name the parameter. In this example, the parameter is named "Sales Threshold"
2. For Data Type, choose Float
3. Right-click [Sales Threshold] in the data pane and select Show Parameter Control
4. Select Analysis and then Create Calculated Field
5. In the Calculated Field dialog box that opens, do the following, and then click OK:
1. Name the calculated field. In this example, the calculated field is named "Customer or Others"
2. In the formula field, type a formula similar to the one described in the Knowledge Base article
6. Drag [Customer or Others] to the Rows shelf
7. Drag SUM(Sales) to Details

Option 2: Use Set Actions
Step 1 - Create a Source sheet
1. Drag [Customer Name] to the Rows shelf
2. Drag [Sales] to the Columns shelf
3. Drag a second copy of [Sales] to Label on the Marks card

Step 2 - Create the Target Sheet
1. Right-click [Customer Name] in the data pane and select Create and then Set…
 2. In the Create Set dialog, do the following and click OK:
1. Give the set a name. In this example, the set is named "Selected Customers"
2. Make sure there is at least one checked and one unchecked customer
3. Drag [Selected Customers] to the Rows shelf.
4. Right-click the word "In" in the view and select Edit Alias.
5. In the Edit Alias dialog, type something like "Selected Customers" and click OK.
6. Repeat steps 4&5 for "Out" and rename it "Other customers".
7 Drag [Sales] to the Columns shelf
8. Drag a second copy of [Sales] to Label on the Marks card.

Step 3 - Create the Dashboard
1. Create a new dashboard and add the source and target worksheets
2. Navigate to Dashboard and then Actions…
3.In the Actions dialog, click Add Action and then Change Set Values…
4. In the Add Set Action dialog, do the following:
For Source Sheets, check only Source Sheet
For Run action on, choose Select
For Target Set, in the first drop-down select the data source being used
For Target Set, in the second drop-down select Selected Customers
For Clearing the selection will, select Remove all values from set
5. Click OK twice to close all pop-up windows.

- - - - - - - - - - - - - -


Subscribe to the Tableau YouTube channel here:


Free Trial of Tableau:

tableau,tutorial,how to,data visualization,gss,sets,

Post a Comment

0 Comments