0
0
Tableaubi_tool~10 mins

Device-specific layouts in Tableau - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

Sales data by device type for a company

CellValue
A1Device
B1Sales
A2Desktop
B21000
A3Tablet
B3600
A4Phone
B4400
Formula Trace
IF [Device] = 'Phone' THEN 'Phone Layout' ELSEIF [Device] = 'Tablet' THEN 'Tablet Layout' ELSE 'Desktop Layout' END
Step 1: [Device] = 'Phone' for each row
Step 2: IF condition for Phone is True, assign 'Phone Layout' else check next
Step 3: [Device] = 'Tablet' for remaining rows
Step 4: Assign 'Tablet Layout' if True else 'Desktop Layout'
Cell Reference Map
   A       B
1 Device  Sales
2 Desktop 1000
3 Tablet  600
4 Phone   400

References: [Device] column used in IF conditions
The formula uses the Device column values from A2 to A4 to decide layout
Result
   A       B      C
1 Device  Sales  Layout
2 Desktop 1000   Desktop Layout
3 Tablet  600    Tablet Layout
4 Phone   400    Phone Layout
The new Layout column shows which device-specific layout applies to each device type
Sheet Trace Quiz - 3 Questions
Test your understanding
What layout is assigned to the Tablet device?
APhone Layout
BTablet Layout
CDesktop Layout
DNo Layout
Key Result
IF device equals 'Phone' THEN 'Phone Layout' ELSEIF device equals 'Tablet' THEN 'Tablet Layout' ELSE 'Desktop Layout'