KNOWLEDGE BASE

Unable to Use Groups in Calculated Fields


Published: 18 Jul 2014
Last Modified Date: 26 Mar 2020

Issue

Unable to use groups in calculated fields.

Environment

Tableau Desktop

Resolution

Option 1

Upgrade to Tableau Desktop 10.0 or newer. See Upgrade Tableau Desktop


Option 2

​Create a set from the group, and then use the set in the calculated field.
  1. In the Data pane, right-click the group, and then select Create Set.
  2. In the Create Set dialog box, do the following, and then click OK:
  • For Name, enter a name.
  • On the General tab, select the group.

Option 3
Create the group using a calculated field. 
Note: You must first know the members of the dimension that will comprise the group. If there are aliases on the dimension members, the calculation must use the original member name. 
  1. Select Analysis > Create Calculated Field
  2. Name the field, enter a calculation similar to the following, then click OK: 
    IF [Container]=’Jumbo Box’ then ‘Big Containers’
    ELSEIF [Container]=’Jumbo Drum’ then ‘Big Containers’
    ELSEIF [Container]=’Large Box’ then ‘Big Containers’
    ELSEIF [Container]=’Medium Box’ then ‘Midsize Containers’
    ELSEIF [Container]=’Wrap Bag’ then ‘Midsize Containers’
    ELSEIF [Container]=’Small Box’ then ‘Little Containers’
    ELSEIF [Container]=’Small Pack’ then ‘Little Containers’ 
    END
     
The above calculation creates a group with three values: Big Containers, Midsize Containers, and Little Containers. 
Did this article resolve the issue?