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)
I then set up a RANK, using this field (and I use RANK_DENSE here so I get a single RANK per product)
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 1-5...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 fine-grained 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