8 Replies Latest reply on Aug 18, 2015 2:07 PM by Kelly Sedlak

    Multilevel dropdown or hierarchy

    Arindam Lahiri

      HI,

       

      Is there an option of group elements (categorize) elements showing the parent as well as the child.

       

      Somethig like this:

       

      A

        A1

        A2

        A3

      B

        B1

        B2

       

      I am aware tat I can category the elements to A and B but in that case it will only let me select A or B and the graphs will show the children.

       

      -Arindam

        • 1. Re: Multilevel dropdown or hierarchy
          Derk Busser

          Are they member of the same dimension?? Or different dimensions?

           

          If they are from the same dimension, then you can Make a Group by selecting multiple values from the dimension and right-click --> "Group". A new dimension is then created called: "[Dimension name] (group)". To add the original dimension, just drag it onto the column or row tab.

           

          Check out my example workbook.

           

          -Derk

          1 of 1 people found this helpful
          • 2. Re: Multilevel dropdown or hierarchy
            Arindam Lahiri

            Thanks Derk,

             

            But this is not exactly what I want. Your solution will categorize to classes but if I use them as quick filter it will only show me the parents. I want the children as well in selection for quick filter.

             

            See my snapshot:

            The quick filter Product (group) only shows the category not the children under it.

            PastedGraphic-45.png

            • 3. Re: Multilevel dropdown or hierarchy
              Derk Busser

              Ah! i understand.

               

              I guess there are two options then, either creating a calculated field that concats the two dimensions e.g. [product (group)] + " - " + [product]. Then the filter options would be for example "Good coffee - Amaretto".

               

              Otherwise, wich will probably be more consuming, you can create a parameter with your dropdown. Then you need to create a calculated field with a number of IF or CASE statements that probes the value of the Parameter and identifies it as either a group or product dimension that has to be filtered. Also, by making it a parameter, only 1 value can be active at one time.

               

              I will create a small example when i get to work

               

              -Derk

              • 4. Re: Multilevel dropdown or hierarchy
                Roy Dar

                Hi,

                 

                I actually have the same requirement.

                We need to have a category filter.

                The category is a single dimension but each category have a parent category, so in the end the result is hierarchical.

                Also, all the categories in the system are dynamic and controlled by the application user.

                To support this in a filter I need to overcome the following issues:

                1. Display issue, need to show an hierarchical view of the categories in the filter

                2. When filtering by a category all the data which is not directly attached to that category, but is attached to any category down the tree should also be shown.

                 

                -Roy

                • 5. Re: Multilevel dropdown or hierarchy
                  Andrew Porter

                  Here is what I did, it's bit kludgy. The assumption is that you don't have Parent/Child relationships defined in other dimensions and just have a single dimension that you want to arbitrarily build into a hierarchy.

                   

                  Say we have a table Produce and Column ProduceType with values "Carrot" "Lettuce" "Broccoli" "Banana" and "Peach". Say we want to create a simple hierarchy that looks like this:

                   

                  ProduceType

                       Fruit

                            Banana

                            Peach

                       Vegetable

                            Broccoli

                            Carrot

                            Lettuce

                   

                  The premise in Tableau is to essentially build a Calculated Field into a Level 0 mapping table. In order to get the hierarchy, I appended parent relationships onto the Level 0 values which can be aliased off later.

                   

                  Here is my Calculated Field Formula. The Calculated Field will be called "Lev0_ProduceType"

                   

                  IF [ProduceType] = "Banana" THEN "Fru_Banana"

                  ELSEIF [ProduceType] = "Peach" THEN "Fru_Banana"

                  ELSEIF [ProduceType] = "Broccoli" THEN "Veg_Broccoli"

                  ELSEIF [ProduceType] = "Carrot" THEN "Veg_Carrot"

                  ELSEIF [ProduceType] = "Lettuce" THEN "Veg_Lettuce"

                  END

                   

                  lev0.jpg

                   

                  After that, we need to create another Calculated Field Dimension that parses out the parent level. This just pulls the Produce sub-type designator we appended in the above Calculated Field.

                   

                  LEFT([Lev0_ProduceType],FIND([Lev0_ProduceType],"_")-1)

                  sub.jpg

                  After that, drag the two Calculated Fields into hierarchy and this should do it.

                   

                  hier.jpg

                  Notes

                  1) This method isn't feasible for large hierarchies or data sets. This is a around for what other technologies like Essbase do natively. Coincidentally Tableau knows Essbase quite well,  Multidimensional Hierarchies

                  From the start, just have all the levels defined in your data source and make a hierarchy.

                  2) You can combine multiple dimensions into the same hieararchy without any issue, you just need to identify the appropriate dimension in your Level0 calculated field.

                  3) Your Level 0 nodes will show up as having the "Veg_" and "Fru_" initially, but you can Alias these out

                  4) In theory you could add more levels of parent relationships with more complex appends to your Level 0s. For example you could potentially map to "Veg_Green_Broccoli", "Veg_Orange_Carrot" etc if you wanted to create more levels of breakdown. I think you'd need to add more Calculated Fields to handle, one for each Level.

                  • 6. Re: Multilevel dropdown or hierarchy
                    Josie Kung

                    Hi,

                     

                    I was wondering if this issue was resolved? I am experiencing the same issue and would like to create a multi level fiiter.

                     

                    Thanks

                    • 7. Re: Multilevel dropdown or hierarchy
                      Jeremy Everett

                      Is there a way to print the select hierarchy levels and the one below it without printing the aggregated numerical values attached to the hierarchy?

                       

                      For example:

                      Food > Meat > Beef > Hamburger

                      Food > Meat > Beef > Filet

                      Food > Meat > Chicken > Breast

                      Food > Meat > Chicken > Nuggets


                      If I choose Food > Meat, it will print:

                      Food > Meat > Beef

                      Food > Meat > Chicken

                       

                      If I choose Food > Meat > Chicken, it will print:

                      Food > Meat > Chicken > Breast

                      Food > Meat > Chicken > Nuggets


                      To display on the page without printing the aggregated numbers

                      • 8. Re: Multilevel dropdown or hierarchy
                        Kelly Sedlak

                        I am looking for this.........has it been developed yet?