3 Replies Latest reply on May 21, 2018 7:23 AM by Saikrishna Mamidi

    Context Filters vs Normal Filters for Sets

    Saikrishna Mamidi

      Hi Techies,


      My requirement is to show top 10 values from list, so I created Sets. But the problem is, I am having around 7 other filters to be applied before. And few of them are quick filters, few of them are from primary data source. So what is the best way to get top 10 list.

      I made all the filters as Context, the results are tallying and they are good.

      My question is., I hear that Context filters may kill the performance (as they are using in Quick filters).  Is there any better solution for this scenario or I should continue with making almost all filters context

      Kindly give any suggestion. Your help is appreciated Thank you.

        • 1. Re: Context Filters vs Normal Filters for Sets
          Saikrishna Mamidi

          Any advice or best practice please.?

          • 2. Re: Context Filters vs Normal Filters for Sets
            Simon Runc

            hi Saikrishna,


            So the way sets and FIXED LoDs work is that they are computed before any "regular" filters are applied, by making a filter a context one, you are bumping the filtering up the calculation pipeline and so before the Set or LoD is computed. What a context filter is doing (broadly!) is making a "temp" table of just the "in context" stuff, and then running any subsequent queries from there. This is where the performance cost can come. However there are situations where it also improved performance. If you have a huge dataset, but a user is only interested in a small subset (say a single category), by making the category a context filter and cost from the temp table, is offset by all subsequent queries running off a much smaller data-set (although this is while back, so advice may have changed, the old White Paper on this say if you are filtering out around 90% of the data, it's a good idea). If you have lots of filters though, and they are "relevant values" only this will have a (potentially) larger cost, as Tableau needs to run a whole set of queries every-time one is changed, to get the listOfValues for the others. I'd say if the performance is fine then carry on. Sets and FIXED LoDs in themselves can also have be detrimental to performance. Attached is an alternative method using Table Calculations. Let me know if it doesn't make sense.

            • 3. Re: Context Filters vs Normal Filters for Sets
              Saikrishna Mamidi

              Thank you Simon for advice. As of now, my business is okay for performance, they did not complaint. I will consider about Using Rank and give a try to remove filters from Context,  Will Compare.  Thank you again.

              About Filters, most of them are different dimensions, not like (Country --> State,  Category --> Sub Category).