5 Replies Latest reply on Jan 29, 2017 1:03 PM by loic lotito

    how to display only combined categories on a map

    loic lotito

      EDIT : i have uploaded the good file with the extension . TWBX

       

      Hello,

      I have a map where all the customers of a company are represented.

      Each customer can purchase several product categories.

      So I placed a quick filter to select only customers who bought a specific product categories combination.

      However, the table continues to display customers who only purchase the product C or B.

      I would like to retain only the customers bought the product C and B (or other combinaison)

       

      I highlighted on the image the customers who should be the only ones to appear


      I tried this tutorial but without success...
      Https://community.tableau.com/message/131574#131574

       

      Thx

       

      Loïc

      Display only combined categories..PNG

       

      EDIT : i have uploaded the good file with the extension . TWBX

        • 1. Re: how to display only combined categories on a map
          Joe Oppelt

          Quick filters only do "OR".

           

          And you uploaded a .twb" file.  Others can't open your twb file.  You need to extract a packaged workbook (FILE -> "Extract packaged workbook") which creates a .twbX file.  That allows the data in the file to be opened by others.

           

          You'll have to build your own calc to do what you want,  As long as you are on version 9.0 or later (you didn't specify), you can use LOD calcs to do what you need.

           

          An example:

           

          { FIXED [Customer] : SUM( IF [Product] = "C" then 1 END ) }

           

          That calc would give you the number of [Product] = "C" rows for each customer.  Do the same for [Product] = "D".  (Note:  You can use parameters to hold "C" and "D" so that users can select what to look for.)

           

          Then you have a calc that says:

           

          IF [C Calc] > 0 AND [D Calc] > 0 then 1 else 0 END

           

          Put that on the filter shelf and select for 1.  That would give you all [Customer]s who have both C and D rows.

          • 2. Re: how to display only combined categories on a map
            loic lotito

            Joe thank you a lot for this answer, I just replace my file by the one in tbwx.

            Handling works well for two product categories. This allowed me to know the LOD function

            I tried several things to be able to do the same thing with 3, 4 or 5 categories randomly. But nothing really works. I have to deliver a tool usable by anyone across table reader.

            I am sorry for my misunderstanding of the product. I'm more skilled with data mining.

            • 3. Re: how to display only combined categories on a map
              Joe Oppelt

              I can't think of a way to do this.  Not easily anyway.

               

              And here is a problem with this thread.  Once there are a series of responses on a thread, a lot of times people figure it's well under way and don't join any more.

               

              So here is what I did.

               

              I made a new thread and re-stated the problem so that the response count is zero.

               

              This is the new thread:

               

              Make something that looks like a quick filter, but does "AND" instead of "OR"

               

              I'm still going to try some things out.  I haven't given up.  But I wanted to encourage fresh eyes to look at it too.

              • 4. Re: how to display only combined categories on a map
                Joe Oppelt

                Oh wow.  I just figured it out.

                 

                See attached.  Sheet 1.

                 

                I do one calc that figures out how many categories were selected.

                 

                { exclude [Customer ID], [Product Categories]  : COUNTD([Product Categories]) }

                 

                And another that does a COUNTD of products for the customer.


                If they are equal, that customer has all the selected products.  If not, filter out that customer.

                2 of 2 people found this helpful
                • 5. Re: how to display only combined categories on a map
                  loic lotito

                  Joe, it's really nice. I never thought of trying to solve the problem with this approach. It's amazing.

                  In addition to getting me out of a real problem, i will be able to apply the technique for many uses ! How can I thank you ? Maybe by becoming myself as active as you were to help me.

                  Sorry for my delay to answer you, the jetlag does not help too ^^

                   

                  Greeting from Lyon - France