1 Reply Latest reply on Nov 9, 2018 3:55 AM by Simon Runc

    Top filter preference

    Danish Haroon



      I have the following dashboard which shows the top 5 vendor by Expense Total Amount

      However when I choose a given State (e.g. AK), then it shows the vendor that belongs from AK. Whereas I want it to show the first 5 vendors for that state as a function of the Expense Total Amount.


      Packaged Tableau file attached


      Best Regards


        • 1. Re: Top filter preference
          Simon Runc

          hi Danish,


          I think you just need to add and filters to be "context" filters. The way Tableau implements the Top N filter is that is is computed before any regular filters are applied. So with nothing filtered it shows the Top 5, but when you filter to a state it will show an Vendors for that state which are in the global top 5. By adding a filter to context, it bumps the filter up the calculation pipeline so it takes affect before the Top 5 is computed (the filter will also go grey/brown to indicate it's not a context filter.



          btw there is only one vendor for AK, but for other states (with more than 5) it will show the Top 5.


          Hope that helps