Thanks for the article, the workaround is really helpful and it did work.
However it falls apart when the dataset becomes too large and often this is the case in my case as the the transactional data are millions x10 per day - or maybe we have an inefficient backend database which unfortunately is beyond my control. It would be great if Tableau can build a proper Top 10 Filter functionality in the not too distant future. Perhaps it's already in the pipeline - do you know how I could check what is the functionality nominated by the Tableau Prep community/ users?
1 of 1 people found this helpful
I'm very hopeful to see this feature in future releases too, because the work-around in the post above does have performance issues for very large data sets and is also a bit limited in the type of ranking it can do.
I don't see an idea specifically for a Top N filter, but I'd definitely upvote it.
You mentioned a backend database. Another thought would be if you can use Custom SQL to get the top 10 products as part of the source query. It might be (though there are various ways to write it based on your database) something like:
SELECT top 10 [Product ID], SUM(Sales) AS [Total Sales]
GROUP BY [Product ID]
ORDER BY SUM(Sales) DESC
you could then inner join that to your product data (either in the flow or in Custom SQL) to limit the source data to only the top 10 products.Hopefully the query would be far more efficient.
Hope that helps!