Tableau Table Calculations 2 — Questions and Answers
Question 1: What does FIRST() return in a Tableau table calculation?
- The first value in the partition
- The number of rows from the current row to the first row of the partition (Correct answer)
- The index of the first row (always 1)
- The minimum value within the partition
Correct answer: The number of rows from the current row to the first row of the partition
FIRST() returns the offset (distance) from the current row to the first row in the partition, which is zero at the first row and negative for all others.
Question 2: In Tableau table calculations, what does the term 'partition' refer to?
- The subset of data within which the table calculation restarts (Correct answer)
- A filter applied before the query runs
- A group of measures computed together
- A dimension added to the Rows shelf
Correct answer: The subset of data within which the table calculation restarts
A partition defines the scope within which a table calculation resets and computes independently, while addressing defines the direction the calculation moves within that partition.
Question 3: What role do 'Addressing' fields play in a Tableau table calculation?
- They filter which records are included in the calculation
- They define the direction the calculation traverses within each partition (Correct answer)
- They set the granularity for measure aggregation
- They determine which measures are visible in the view
Correct answer: They define the direction the calculation traverses within each partition
Addressing fields specify the direction (across rows, down columns, etc.) the table calculation moves when computing values within each partition.
Question 4: Which formula correctly calculates percent of total using a table calculation in Tableau?
- TOTAL(SUM([Sales])) / SUM([Sales])
- SUM([Sales]) / TOTAL(SUM([Sales])) (Correct answer)
- PERCENT(SUM([Sales]))
- SUM([Sales]) / RUNNING_SUM(SUM([Sales]))
Correct answer: SUM([Sales]) / TOTAL(SUM([Sales]))
Percent of total divides the current value by TOTAL(), which returns the grand total across the partition, giving each row's share as a decimal.
Question 5: What does WINDOW_AVG() compute in Tableau?
- The average of all measures across the entire workbook
- The average of an expression over a specified window of rows within the partition (Correct answer)
- A moving average updated automatically with new data
- The average value excluding null rows only
Correct answer: The average of an expression over a specified window of rows within the partition
WINDOW_AVG(expression, [start, end]) computes the average of the expression across a defined range of rows within the current partition.
Question 6: When using LOOKUP() in Tableau, which offset value references a future (upcoming) row?
- A negative value
- Zero
- A positive value (Correct answer)
- NULL
Correct answer: A positive value
A positive offset in LOOKUP() looks ahead to future rows (e.g., LOOKUP(SUM([Sales]), 1) returns the next row's value), while negative offsets look back.
Question 7: Which Quick Table Calculation shows the absolute change between consecutive period values?
- Running Total
- Percent of Total
- Difference (Correct answer)
- Rank
Correct answer: Difference
The 'Difference' Quick Table Calculation subtracts the previous period's value from the current value, showing period-over-period absolute change.
What does FIRST() return in a Tableau table calculation?