I looked at this post and have been working with the workbook supplied (Thank you very much) and the limitation of top n is typically controlled via a table calculation and this is late in the order of operations after the evaluation of context filters which is where I think this needs to be to work. I think it's worth calling out Ian Baldwin again here and to at least see if Jonathan Drummey has any thoughts on this one. I know better than to ever say "not possible" in Tableau but I can not find a working solution in the time I have played with your workbook.
How have you progressed since this original post?
3 of 3 people found this helpful
I took a quick look at this (ok, a longer look) and figured out the problem.
Here's a view where I've taken out the bin and adjusted the Sankey Arm Size compute using to show the expected size for each combination of the dimensions:
Now in this view I've added the bin in, along with some commentary:
Both of these issues are due to a cascading set of factors:
- The data source is built on a kind of self-join, it looks like to do some sort of market basket analysis?
- The way the Dimension 1 and Dimension 2 variables are built (one from the left side of the join, the other from the right) effectively creates a sparse data set.
- The binning using the FIXED LOD in the Path Frame field depends on a complete domain of data (the Revenue measure in this case).
- With sparse data the Revenue values that are binned don't necessarily have enough values to create all the necessary bins (The Female/Fruit & Veg problem).
- In addition due to the sparseness the chosen measure changes values based on the bin (the Female/Meat/0 problem).
Given sparse data the FIXED LOD method to create bins is fundamentally unreliable (Also the fact that the final view needs to add a filter just adds to the sparseness). The workaround is to use an alternative method to build the source where you'd create a data source with two copies of the data to create the Path Frame. Given the complexity of the existing source the way I'd do that is with a cross join on a 2 row data source, see Cross Data Source Joins + Join on Calcs = UNION Almost Anything in Tableau v10.2 for details on how to do that.
Note that you'd have to adjust any additive measures to deal with the multiple copies of the data, given that you want to use COUNTD(Id) as the measure here that wouldn't be the problem. However for the Sankey Arm Size and the % of Totals for the bars the measure would need to be something like COUNTD([Id]) / WINDOW_SUM(COUNTD([Id]), potentially with additional (prior) calculations to handle replicated values due to the two copies of the data.
Hi guys, Jonathan Drummey and Patrick A Van Der Hyde thanks so much for the help! I'd given up on this post and took a chance logging in today... oddly enough I never received any notifications of your responses at all, not even in my Tableau message inbox. Not even sure how your message got marked as correct, but saved me the trouble! Thanks again - I was starting to think this wasn't possible.