
1. Re: Top N when looking by multiple dimensions including Customer
Simon Runc Dec 13, 2016 4:31 AM (in response to Nicola Prime)hi Nicola,
So yes this is a bit of a tricky one...where you want to RANK at a certain level (Product) but the VizLoD is at another (Product/Customer).
One way to do this is as follows...
First I set up a Window_Sum on Quantity so I can return a single quantity value for each product (and not a value per customer/product)
[Quantity WS]
WINDOW_SUM(SUM([Quantity]))
I then set up a RANK, using this field (and I use RANK_DENSE here so I get a single RANK per product)
[Quantity RANK]
RANK_DENSE([Quantity WS])
Now as I've nested the [Quantity WS] in the [Quantity RANK], I get the option to set up the compute using differently (the redbox shows where you can access each calculation)...
So we set up the [Quantity WS] like
and the [Quantity RANK] as Table Down (or include all dimensions if your pill arrangement isn't the same as my example)
Then we can just filter on the [Quantity RANK] and show just 15...the 'Product Rank' tabs shows just the Product Ranks, so you can verify its picked up the correct 5 products.
As a simple alternative...I've also included a version just using the Top N filter built into Tableau (and also used the negative of the Window_Sum to sort them)...
This tends to not give the finegrained control of using index/rank, but might work and is much much easier!!!
Hope that helps and makes sense, but let me know if not

Rank at different level to Viz.twbx 501.2 KB
