KNOWLEDGE BASE

Creating Dynamic "Others" Group based on User Selection


Published: 23 Sep 2015
Last Modified Date: 10 Aug 2018

Question

How to create dynamic groups based on the user selection.

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."

Environment

Tableau Desktop

Answer

The following instructions can be reviewed in the attached workbook, which can be found in the upper right hand corner of the webpage.
  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 > 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, create a calculation similar to the following:
      IF { Fixed [Customer Name] : SUM(Sales) } >= [Sales Threshold] 
      THEN [Customer Name] 
      ELSE "Others"
      END
  6. Drag [Customer or Others] to the Rows shelf
  7. Drag SUM(Sales) to Details
Did this article resolve the issue?