3 Replies Latest reply on May 7, 2012 7:59 AM by betty.chen

# index to a specific cell in tableau

Want to know how calculate the % of a floating variable.  For example (as highlighted in attached): i have a 1 to 6 ranking.  For each ranking I want to know how they compare to ranking 3.  In excel it would a simiple formula where I can freeze the cell, but need to know how to do in tableau.

• ###### 1. Re: index to a specific cell in tableau

Presuming your data looks exactly like this, you can do this:

Divide the current row by the lookup up the 3rd value of average when sorted by index

The calc is:

attr([Avg])/lookup(attr([Avg]),first()+2)

Attr(avg) is the current row value. We need attr as we're using window calculations. Divide this by the Lookup result of the 3rd row (lookups are relative to the current row unless we force it to first() plus 2

Then when this is added to the sheet, we have to choose the correct partitioning (edit table calculation from right clicking the pill). Then advanced, and have both avg and rank on the right side (then we only have one partition). Finally we must choose how to determine what is the 3rd row - in this case by sorting by index ascending.