KNOWLEDGE BASE

How To Create A Column Describing The Value On Which The Table Calculation Is Based On


Published: 03 Feb 2020
Last Modified Date: 03 Feb 2020

Question

How to create a column describing the value that the table calculation is based on

Environment

  • Tableau Desktop

Answer

1. Create a view like below showing the difference in sales for every week from the previous year:
User-added image

2. Create a calculation called Based on value with the following formula:

STR(ATTR(YEAR([Order Date])))+"-"+STR(LOOKUP(ATTR(YEAR([Order Date])),-1))

3. Drag the Based on value calculated field in between the dimensions and change the compute using to Pane Down

User-added image


4. Ctrl drag the Based on value calculated field from rows to filters shelf and deselect the Null value:

User-added image
5. Right- click the Actual dimension for which the table calculation is calculated based upon (In this case Year[Order Date]) and deselect the Show Header option.

User-added image 

Please find the attached workbook for the solution.
Did this article resolve the issue?