0
0
Tableaubi_tool~10 mins

Dynamic dimension swap in Tableau - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the calculation to create a parameter control for dynamic dimension selection.

Tableau
CASE [[1]]
WHEN 'Category' THEN [Category]
WHEN 'Region' THEN [Region]
ELSE [Segment]
END
Drag options to blanks, or click blank then click option'
ADimension Selector
BSelected Dimension
CDynamic Field
DSwap Parameter
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong parameter name that does not exist in the workbook.
Confusing the parameter with a field name.
2fill in blank
medium

Complete the calculated field to dynamically swap dimensions based on the parameter.

Tableau
IF [Selected Dimension] = 'Category' THEN [[1]]
ELSEIF [Selected Dimension] = 'Region' THEN [Region]
ELSE [Segment]
END
Drag options to blanks, or click blank then click option'
ACategory
BSegment
CRegion
DSales
Attempts:
3 left
💡 Hint
Common Mistakes
Returning a different field than the parameter value.
Using a measure field instead of a dimension.
3fill in blank
hard

Fix the error in this calculated field for dynamic dimension swap.

Tableau
CASE [Selected Dimension]
WHEN 'Category' THEN [Category]
WHEN 'Region' THEN [1]
ELSE [Segment]
END
Drag options to blanks, or click blank then click option'
A[Segment]
BRegion
C'Region'
D[Region]
Attempts:
3 left
💡 Hint
Common Mistakes
Using the field name without brackets.
Using quotes around the field name.
4fill in blank
hard

Fill both blanks to complete the parameter and calculated field for dynamic dimension swap.

Tableau
Parameter Name: [1]

Calculated Field:
IF [[2]] = 'Category' THEN [Category]
ELSEIF [Selected Dimension] = 'Region' THEN [Region]
ELSE [Segment]
END
Drag options to blanks, or click blank then click option'
ASelected Dimension
BDimension Selector
DSwap Parameter
Attempts:
3 left
💡 Hint
Common Mistakes
Using different names for the parameter and calculated field reference.
Misspelling the parameter name.
5fill in blank
hard

Fill all three blanks to create a dynamic dimension swap with a parameter and calculated field.

Tableau
CREATE PARAMETER [1] AS STRING
VALUES: 'Category', 'Region', 'Segment'

Calculated Field:
CASE [[2]]
WHEN 'Category' THEN [Category]
WHEN 'Region' THEN [Region]
ELSE [[3]]
END
Drag options to blanks, or click blank then click option'
ASelected Dimension
CSegment
DDimension Selector
Attempts:
3 left
💡 Hint
Common Mistakes
Using different names for parameter and calculated field.
Incorrect field name in ELSE clause.