Using Tableau sets to correctly
sort calculations
A solution to the situation
shown in the previous section is to create a Tableau set and force a proper
sort for a Tableau Quick Table Calculation. Because the set is separate
from the original data, Tableau can act independently upon it.
Step 1
Create a calculated field for
month: MONTH([Order Date]).
Step 2
Create a Tableau set from this
new calculation and call it month sorter.
Step 3
Place this new set on the Level
of Detail shelf.
Step 4
When creating your Difference
From Table Calculation, in the list entitled Calculate the
difference along, select your new set instead of Table (Across),
etc.
Step 5
Now when you use the one-click
sort, it will sort the months, but continue to use your new "sorting
set" to perform the calculation. Because there are two month fields in
play, Tableau understands how to achieve this.
In the image below, you can see
that the months are out of order, but the information is correctly sorted.
We have also provided a finished packaged workbook (upper right corner of
this article) which demonstrates this example nicely.
|
Thanks for your blog very well explained. Keep posting.
ReplyDeletetableau training
learn tableau online