James Bakers wonder guide on how to calculate the rank according to a given variable using "calculated field" scripting:
http://community.tableau.com/thread/108967
The script to calculate standard rank is:
IF ISNULL(SUM([Measure])) THEN
NULL
ELSE
IIF(SUM([Measure]) == LOOKUP(SUM([Measure]), -1),
PREVIOUS_VALUE(1), INDEX(), 1)
END
I want to ask how to turn this rank value as calculated to a String or a dimensional value.
I sense a slight modification of the above script will do the magic....
Thanks in advance!
Hi Joe,
One way to do this is to create a second calculated field that converts the above calculation to a string, similar to the following:
str([Calculation1])
If you wanted it to be different values a calculated field similar to the following could be made:
if [Calculation1]=1 then "First"
elseif [Calculation1=2 then "Second"
etc
etc
end
Hope this helps!
-Tracy
Become a Viz Whiz on the Forums!
Support the Community and master Tableau.