4 Replies Latest reply on Apr 27, 2017 6:44 AM by Ryan Rowland

    Showing values only when All is selected in a quick filter

    aditya gawde

      Hello,

       

      A column has 3 entries and have added the same to quick filter.

       

      We want the value for Web/(Web+App) which are the 3 entries

       

      The value should be visible only when All is selected from the filter.

       

      While the value returned should be blank.

        • 1. Re: Showing values only when All is selected in a quick filter
          Ryan Rowland

          Can't view your workbook, you need to attach a packaged workbook (twbx) not a standard tableau workbook.

           

          However, without knowing any of your field names a calculated field like below should get you on the right path:

           

          TOTAL(countd([CATEGORY FIELD])) = 3

           

          Then drag this field as a filter on your chart only including TRUE.

           

          This will count how many categories are currently in the data, if there are 3 distinct categories it will display true.

          • 2. Re: Showing values only when All is selected in a quick filter
            Zhouyi Zhang

            Hi, Aditya

             

            could you embed your data source or save your workbook as .twbx?

             

            ZZ

            • 3. Re: Showing values only when All is selected in a quick filter
              aditya gawde

              Thanks Ryan. It worked. But there are a few places where there only 2 channels there it is not working though.

               

              How can we edit the same?

              • 4. Re: Showing values only when All is selected in a quick filter
                Ryan Rowland

                Hi Aditya,

                 

                Glad it helped, if they number of categories in your CATEGORY FIELD dimension varies across other dimensions I don't think this will be possible using only a table calc.

                 

                To do this you'll need to use LoD calculations, I can sort of provide guidelines but without knowing the exact dimensionality you want to use (field names etc) it'll be difficult to provide you with a perfect answer.

                 

                total(countd([CATEGORY FIELD])) = max({fixed [dimension field]:countd([CATEGORY FIELD])})

                 

                Where dimension field is the dimension you're using to parititon/filter the data. EG you said "Places" so I'm going to assume you're filtering by country and a specific country only has 2 values in CATEGORY FIELD - replacing DIMENSION FIELD with COUNTRY would fix that.

                 

                If you're filtering multiple dimensions you can add them as follows:

                 

                total(countd([CATEGORY FIELD])) = max({fixed [dimension field],[dimension field 2], [dimension field 3]:countd([CATEGORY FIELD])})

                 

                Hope that helps,

                 

                Ryan.

                 

                EDIT: There is another option but it depends on your use case whether it can be used or not.

                 

                If when your users are filtering on the category field you limit them to only being able to use a single select filter the following table calc will get what you need:

                 

                total(countd([CATEGORY FIELD])) <> 1

                 

                If however you want your users to be able to filter on multiple items in the CATEGORY FIELD, the LoD method is the only way (to my knowledge).