3 Replies Latest reply on Jul 19, 2018 2:23 AM by Arnab Chaudhury

    Group filtering simplification

    Arnab Chaudhury

      Hi Experts,

       

      We are using a filter with ISMEMBEROF clause to filter on Tableau groups:

       

       

      We are getting the below results for a particular user who belongs to: Consumer and Technology Tableau group:

       

      image.png

       

       

      The challenge is to add all the combination of Segment, Category and Sub-category into the group filter which will result to approx 63 combinations which seems manageable here. But our real scenario involves about 6000 combinations, so subsequently writing 6000 if else condition.

       

      Is there there a way to simplify this?

        • 1. Re: Group filtering simplification
          Patrick A Van Der Hyde

          Hello Arnab,

           

          Ismemberof() is a USER group function related to the groups on Tableau Server and is not related to the data within the data source.  - User Functions

           

          I'm not understanding the final goal for this grouping.  Please elaborate.  Also, please review the section of the online help related to Hierarchies.

          https://onlinehelp.tableau.com/current/pro/desktop/en-us/help.html#qs_hierarchies.html?Highlight=hierarchy

           

          Thank you

           

          Patrick 

          • 2. Re: Group filtering simplification
            Esther Aller

            Hi Arnab,

             

            I feel your pain on this one! Unfortunately the ISMEMBEROF() functions requires a string literal and cannot use a string field, which would make this calculation much simpler.

             

            The Ideas section allows customers to add, comment, and vote on features they would like to see in the product. Votes are used to help prioritize new features. Our Development team also loves to see everyone's use cases in the comments, which helps them better design features that will meet the most possible needs.

             

            I recommend voting on https://community.tableau.com/ideas/3314

             

             

            In terms of playing around with that calculation... I couldn't find a more elegant way to write it. The issue I was hitting up on was if a user is only a member of "Corporate" they should see all categories and subcategories. However there is no way to know that the user is only part of one group. One potential solution would be requiring that the user belongs to at least one group of each type (one segment group, one category group, one sub-category group). You could add an "All" group to each type. Then maybe the calculation could be:

             

            (

                 ( ISMEMBEROF("Consumer") AND [Segment] = "Consumer" )

                 OR

                 ( ISMEMBEROF("Corporate") AND [Segment] = "Corporate" )

                 OR

                 ( ISMEMBEROF("Home Office") AND [Segment] = "Home Office" )

                 OR

                 ISMEMBEROF("All Segement")

            )

            AND

            (

                 ( ISMEMBEROF("Furniture") AND [Category] = "Furniture" )

                 OR

                 ( ISMEMBEROF("Technology") AND [Category] = "Technology" )

                 OR

                 ( ISMEMBEROF("Technology") AND [Category] = "Technology" )

                 OR

                 ISMEMBEROF("All Category")

            )

             

            The above calculation is only taking into account category and segment groups, but should cover all combinations of category and segment

             

            Hope that answers your question!

            • 3. Re: Group filtering simplification
              Arnab Chaudhury

              Hi Esther,

               

              Thank you for the idea of "All" group to each type. I have used a similar approach however this time used multiple user filter instead of the aforementioned huge multi line if-else filter. I created User filters as one for segment group, one for category group, one for sub-category and so on for all the combination and placed in the filter shelf.

               

               

              Thanks,

              Arnab