1 of 1 people found this helpful
So one way to achieve this (and the one I tend to for due to its flexibility) is to use index(), and then filter the Top N using this index value.
There is an explanation and workbook on this post
Not your exact situation, so if you can't get this to work for you, or doesn't make sense please post back
...I should have also directed you to this very interesting discussion on the 'Order of Operation'...
as you can see when it comes to "Confusion about filter order of operations" you are not alone, including some of Tableau's Great & Good!!!
Interesting. On first glance, that may work for me. Need to play around with it some more.
I also realized a better example of what I'm trying to do is found in Alexander Mou's post here. I've tried changing my filters to context filters, but that didn't work. I'm actually trying to do this using filters across a primary source and secondary source, so not sure if that's what's causing the problem.
Adding the INDEX filter appears to work for the most part with the way I've got this set up.
The only problem I'm still finding is that if I change the criteria of my dimension filters in a way that adds more rows, the list is no longer sorted properly. So it requires me to undo my INDEX filter, resort the rows from top to bottom, then re-apply my INDEX filter.
Yes Alexander has done a lot of great work in trying to decipher the filter pipeline...and yes adding filters to context is a way to 'force' them up the pipeline (although there is a performance cost to this, but you'll only notice if you are using a fairly large data-set).
Yes blending can be an issue...and again this is due to when the 'blend' takes place in the pipeline! (especially when applying secondary datasource filters). Have a go with the index() as by setting this up the right way, will always show you 10 of something...also being a Table Calc filter (which as you can see gets performed last) means that what actually happens it that the view is filtered but the underlying data isn't.
If you can't get it to work...I might need to see a mock up of your situation so I can have a bit of a play.
So 2 things here. One is to ensure you set up the INDEX() partitioning and addressing to correct dimensional levels, and the second thing (if you look at the post I referred you to), is that you can sort the index() on a field in the 'Advanced' settings. This way you shouldn't need to re-sort the Viz to get the index going in the right direction.