Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a pivot table that shows totals in the order that I want to show them.
I'd like to add a column at the beginning that simply enumerates the rows that are already there (so 1,2,3,4,...) just to help people see the ranking of each row (similar to the row numbers on the left in Excel).
Is there an easy way just to add these numbers? I'd use the rank feature but my columns are already complicated dimensions using multiple ranking calculations.
FYI, I figured this out. I used the aggr and rank functions to do this. This ranks a customer by their current vs prior gap.
Here is my code (simplified):
=aggr( rank(total
aggr( Sum (YTDSales) - Sum (PrevYrSales),PayerName) ,0,1) ,PayerName)
Use the rowno() function.
The RowNo function might mess up your ranking functions in the expressions. If so, I would simply use a Count distinct of a unique value that defines each row, such as an ID:
Count(Distinct ID)
Thanks,
Aline
Neither of those suggestions are working for me.
Rocky, in the help docs it only describes rowNo in the context of input files. Could you give an example of how this might work in a chart as a calculated dimension?
FYI, I figured this out. I used the aggr and rank functions to do this. This ranks a customer by their current vs prior gap.
Here is my code (simplified):
=aggr( rank(total
aggr( Sum (YTDSales) - Sum (PrevYrSales),PayerName) ,0,1) ,PayerName)