Common Table Calculations - Tableau
- What value does the calculation return at the March mark? Answer: , because the window follows the displayed order from March through January. When working with Tableau window functions, the key is understanding that
FIRST()andLAST()are relative to the current row's position in the partition's displayed order — not absolute calendar positions.WINDOW_SUM(SUM([Sales]), 0, LAST())means: start at the current mark (offset ) and extend to the last mark in the partition. Since the months are displayed in descending order — April (rank 1), March (rank 2), February (rank 3), January (rank 4) — "last" means January, the final row in that displayed sequence. At the March mark, the window spans from March through the end of the displayed order: March () + February () + January () = . That confirms C is correct. Choice A is tempting but wrong: it assumes "later" means later on the calendar, so it includes April. But April appears before March in the displayed order, and the window only looks forward (toward the last row), not backward. Choice B reflects a common misconception thatLAST()always returns the full partition total — it doesn't.LAST()is a relative offset from the current row to the final row, so the window shrinks as you move down. At April's mark, the sum would be , but not at March's. Choice D assumesLAST()means "one row forward," confusing it with an offset of rather than the distance to the partition's end. Your study tip: always sketch the displayed row order and mentally place your "cursor" at the mark in question — then count forward toLAST()to identify which rows fall in the window. - When configuring Compute Using > Specific Dimensions, which setup satisfies the requirement? Answer: Select Month; leave Region and Year unselected as partitioning dimensions. Whenever you see a question about
WINDOW_SUMor any table calculation with Compute Using > Specific Dimensions, anchor yourself to this core rule: the dimensions you select are the ones the calculation moves across (the addressing dimensions), and the dimensions you leave unselected define the partitions — the boundaries where the calculation restarts. In this scenario, you want the window sum to sweep across all months within each Region-Year group, then restart when Region or Year changes. That means Region and Year must act as partitioning dimensions (unselected), and Month must act as the addressing dimension (selected). Selecting only Month achieves exactly this: Tableau computesWINDOW_SUM(SUM([Sales]))across every Month value, restarting fresh for each unique Region-Year combination. That's precisely answer A, the correct choice. Answer B selects Year alongside Month, which removes Year from the partition. The calculation would then sweep across both months and years within each Region group, collapsing year boundaries you need to preserve. Answer C selects Region and Month, removing Region from the partition, so the sum would span across regions — the opposite of restarting when Region changes. Answer D selects all three dimensions, leaving nothing to partition on, meaning Tableau computes one grand total across the entire view with no restarts at all. A reliable memory device: think of unselected dimensions as walls and selected dimensions as the path the calculation walks. You want walls around Region and Year, with Month as the only open path — so select only Month and let the walls do their job. - What value does the calculation return for the third mark? Answer: , because each mark adds its change to the prior calculated result. Whenever you see
PREVIOUS_VALUE()in Tableau, the key concept to internalize is that it carries forward a running, accumulated result — not a raw field value — from one mark to the next, computed strictly in display order. Here's how the calculation unfolds forPREVIOUS_VALUE(0) + SUM([Net Change]). At the first mark, there is no prior result, soPREVIOUS_VALUE(0)returns its seed value, . Adding the first net change gives . At the second mark,PREVIOUS_VALUE(0)returns the previous calculated result, which is . Adding gives . At the third mark,PREVIOUS_VALUE(0)returns , and adding yields . That confirms A is correct: each mark accumulates by adding its change to the prior calculated result, producing a running total. B is wrong because it assumes the third mark references the first mark's output (), skipping the second mark entirely —PREVIOUS_VALUEalways references the immediately preceding mark, not any arbitrary one. C is wrong because it treats the "previous value" as the prior raw net change () rather than the accumulated result. D is wrong becausePREVIOUS_VALUEdoes not reset to its seed at every mark — it only uses the seed for the very first mark. A useful mental model: think ofPREVIOUS_VALUE()like a bank balance. Each row deposits or withdraws from whatever balance was left after the previous transaction — it never starts from zero again mid-sequence. - What results are returned for February and April, respectively? Answer: February is , and April is . When you see
WINDOW_AVGin Tableau, think of it as a sliding window that averages values across a specified range of rows relative to the current row. The syntaxWINDOW_AVG(SUM([Sales]), -1, 1)means: for each row, average the current row plus one row before and one row after. For February (value ), the window includes January (), February (), and March (). That gives . For April (value ), April is the last row, so there is no "row after." The window can only reach back one row to March () and include April itself (). That gives . This makes B correct. Choice A gets February wrong by averaging only January and February — — as if the window were-1, 0instead of-1, 1. Choice C correctly calculates February as but then incorrectly includes all remaining values for April, averaging January through April as , confusingWINDOW_AVGwith a running average. Choice D skips the window entirely, returning raw values rather than averages. The key study tip: at partition boundaries, Tableau's window functions don't pad with zeros or repeat values — they simply use whatever rows are available. Always check whether the current row is near an edge, because the window silently shrinks. - What rank does the product receive with
RANK(SUM([Sales]), 'desc'), and what rank would it receive if the calculation were changed toRANK_DENSE?Answer:RANKreturns , whileRANK_DENSEreturns . Whenever you see a question about ranking functions in Tableau, the key is understanding how each function handles ties — because that's the only place they behave differently. Here's the setup: four products have sales of , , , and . In descending order, the ranks work like this. The product is clearly first. The two products are tied — and this is where the functions diverge. WithRANK, ties share the lowest rank they would collectively occupy. Both products tie for rank , but since they consume two positions (2nd and 3rd), the next product skips ahead to rank . So the product receives a rank of . WithRANK_DENSE, ties share a rank but no positions are skipped — the next distinct value simply gets the next consecutive rank. So is rank , both s share rank , and receives rank . That makes D correct. Choice A incorrectly givesRANKa result of , which would only happen if ties didn't consume extra positions — that's actually howRANK_DENSEworks, notRANK. Choice B assigns to both functions, ignoring the gap thatRANKcreates entirely. Choice C assigns to both, missing the fact thatRANK_DENSEnever skips positions after a tie. A useful memory trick: think ofRANK_DENSEas compact — no gaps, no skips. StandardRANKmirrors how Olympic medals work: two silver medalists mean no bronze is awarded, pushing the next competitor to fourth place. - What
INDEX()value is assigned to category A?Answer: , because A is third after the sales sort is applied. When Tableau evaluatesINDEX(), it assigns row positions after all sorting has been applied — meaning the index reflects the final display order, not alphabetical order or any pre-sort sequence. Think ofINDEX()as simply counting "what position am I in this list right now?" Here, the view sorts bySUM([Sales])descending, so the order becomes: B () → C () → A ().INDEX()then walks down that sorted list assigning , , in order. Category A lands at position , making B the correct answer. A is wrong becauseINDEX()has no awareness of alphabetical ordering. It doesn't care that "A" comes first in the alphabet — it only cares about the row's position in the current partition after sorting. C is tempting but subtly flawed: while it's true that two categories have higher sales than A, that reasoning describes rank, not index.INDEX()counts position directly; it doesn't compare values. The result happens to be here, but the logic behind C conflatesINDEX()withRANK(). D is wrong because Tableau'sINDEX()is 1-based, starting at for the first row — there is no zero offset. A useful study tip: whenever you seeINDEX()on the exam, always ask yourself "what is the sort order at the time the table calculation runs?" Sort order transforms the underlying data sequence, andINDEX()simply numbers whatever sequence results. ConfusingINDEX()withRANK()or assuming alphabetical default ordering are the two most common traps here. - What value does
SUM([Sales]) - LOOKUP(SUM([Sales]), -1)return for March?Answer: , because January is the preceding mark in the partition. When working with Tableau table calculations likeLOOKUP(), the critical distinction to understand is that these functions operate on the marks that exist in the view, not on an abstract calendar or continuous timeline.LOOKUP(expression, offset)moves a specified number of marks backward or forward within the current partition — it has no awareness of missing calendar periods. In this scenario, the view contains exactly three marks in chronological order: January (), March (), and April (). When the calculationSUM([Sales]) - LOOKUP(SUM([Sales]), -1)evaluates for March, it looks one mark backward in the partition. The mark immediately behind March in the view is January. So the result is , confirming that A is correct. Choice B gets the arithmetic backwards — the formula subtracts the prior mark from the current mark, not the other way around, so the result is positive , not . Choice C reflects a common misconception: students assumeLOOKUPis calendar-aware and would treat February's absence as a "gap," returning Null. ButLOOKUPsimply counts mark positions — it doesn't know February ever existed. Choice D misunderstands howLOOKUPhandles missing data; it doesn't return the current mark's value when a neighbor is absent, and it doesn't "skip" in any special way — it just steps to the adjacent mark in the view. The key study tip: whenever you seeLOOKUPon the exam, mentally number the visible marks in sequence.LOOKUPalways moves by mark position, never by calendar distance. Missing rows that aren't shown simply don't exist to the function. - What percentage does the calculation return for the current month? Answer: , because profit improved by relative to a base of . When you see a Tableau calculation involving
LOOKUPandABS, slow down and trace the arithmetic carefully — the function names tell you exactly what's happening, and the trap is usually in how signs interact. Here, the formula computes the percent change from the prior month: . Plugging in the values, current profit is and prior profit is , so you get , or 40%. That's answer D. The result is positive because profit genuinely improved — moving from to is a gain of units — and dividing by the absolute value of the prior period ensures the denominator is always positive, giving the sign of the numerator full control over the direction. Answer A claims the result is , confusing the negative sign of the prior value with the sign of the output. ButABSexplicitly removes that negative from the denominator, so it can't drive the result negative. Answer B suggests , likely from dividing the raw change () by the current value () — that's the wrong denominator and misreads the formula entirely. Answer C gets the magnitude wrong ( instead of ) by using the current value as the base rather than the prior value. A useful habit: whenever you seeABSwrapped around aLOOKUP, it's signaling that the base could be negative and needs normalizing. Always substitute real numbers before interpreting the sign of the result. - Which pair gives the calculation results for April and February, respectively? Answer: April is , and February is . When you see
WINDOW_SUM(SUM([Sales]), -2, 0)in Tableau, the key is understanding the offset parameters. The first number () tells Tableau to look two rows back from the current row, and the second number () means the current row itself. So for each mark, Tableau sums the current row plus the two preceding rows. With months ordered January through May and sales of , here's how the window shifts per row: - January (position 1): only one row exists before it, so - February (position 2): - March (position 3): - April (position 4): - May (position 5): April gives and February gives , confirming C is correct. Answer A is wrong because it swaps the values — is May's result, not April's. This is a classic trap where students match the right numbers to the wrong months. Answer B reverses the two: actually belongs to March, not February. Answer D arrives at for April, which would only be correct if the window were (two rows instead of three), suggesting a misread of the offset parameters. As a study habit, always trace through the window offsets row by row on a small dataset — it takes 60 seconds and eliminates nearly every WINDOW function mistake on the exam. - What running-sum value is displayed for March? Answer: , because the hidden earlier marks still contribute to the calculation. Whenever you see a question combining table calculations with filters in Tableau, the critical concept to understand is the order of operations: table calculations execute after filters, but dimension filters and most traditional filters remove data before table calculations run. However,
LAST() = 0is itself a table calculation used as a filter — and table-calculation filters behave differently. They hide marks visually but do not remove them from the underlying partition, so other table calculations still "see" the full dataset. This is exactly why C is correct.RUNNING_SUM(SUM([Sales]))computes across all three months — January (), February (), March () — producing a running sum of , , respectively. ThenLAST() = 0filters the view to show only the last mark (March), but because this is a table-calculation filter, it merely hides January and February rather than excluding them from the calculation. March still displays its fully computed running sum of . A is wrong because it assumes the filter removes earlier months before the running sum calculates — that's true for dimension filters, not table-calculation filters. B is wrong because it implies January was removed from the window, leaving only ; again, no marks are truly removed. D is wrong because hiding marks via a table-calculation filter does not invalidate the result — the calculation remains well-defined. The key study tip: always ask yourself what kind of filter is being applied. Dimension filters remove data before table calculations; table-calculation filters only hide results afterward, leaving the underlying computation intact.