3 Replies Latest reply on Sep 6, 2016 4:05 AM by Simon Runc

    Creating groups for the dimension

    Rashmi G

      Hello All – I have a requirement as follows , please let me know if this is possible in tableau.

      I need to create a Bar chart with 2 legends . One legend indicating the cumulative sum for the selected dimension value and other legend indicating the cumulative sum for the rest of the dimension values. I have attached the bar chart pic I am expecting and the data set to be considered.

       

      Please let me know if this is possible in Tableau.

       

      Thank you,

      Rashmi

        • 1. Re: Creating groups for the dimension
          Simon Runc

          hi Rashmi,

           

          So I think this is what you want...

           

          first I created a calculated field, to group all the 'non-superstore' initiatives into a single group

          [Bar Chart Grouping]

          IIF([Initiative]<>'Superstore','Other Initiative',[Initiative])

           

          which I can then bring onto the colour shelf, and Tableau will stack my bars to these 2 levels.

           

          To get the total label, I've used a reference line (where I set the line to none and bring in the value). Image below shows the set up for the reference line

           

           

          Hope that helps, and makes sense.

          • 2. Re: Creating groups for the dimension
            Rashmi G

            Hi Simon - Thanks for replying !!

             

            What you suggested works for Superstore alone. But doesnt work if the initiative selection is dynamic. For eg : If Initiative selected is "Shakti" then the calculation should be

            IIF([Initiative]<>'Shakti','Other Initiative',[Initiative]).

             

            Can this be done?

             

            Thank you

            • 3. Re: Creating groups for the dimension
              Simon Runc

              So one way to do this is to use a parameter instead of the 'hard-coded' text in the formula.

               

              You can set up a parameter from a field (or import a fields LoVs)...and expose this to the user. As they change the parameter the selection will update accordingly. One thing to note, although you can set up a parameter from a field, it's not dynamic, so if new values appear in that field (after a data refresh), you'd need to add any new values to the parameter.

               

              Does that work for you? or does the data change too much (i.e. you don't want the maintenance overhead)