4 Replies Latest reply on Jun 16, 2017 3:33 AM by Akhilesh Singh

    Hierarchy (Group more measure into one measure)

    Marko Draskovic


      I am not using Tableau for a long time, because of that I am sorry if I did not settle the right title for the question.

      However, I need to group 4 weeks that are 4 different measures like Week1, Week2, Week3 and Week4 into one month and to show me data for all weeks and that month. But only to have one level of hierarchy for all 4 weeks.

      You can see what I want to transfer from excel into Tableau in the picture. This type of grouping. Thank you in advance for helping me.

        • 1. Re: Hierarchy (Group more measure into one measure)
          Wilson Po

          Hi Marko,

          While we can't group measures, you might use the Pivot Data from Columns to Rows functionality to transform a Week column to group into months.  I would see if that helps or post a workbook so we can see what other solutions might help out with your data. 

          • 2. Re: Hierarchy (Group more measure into one measure)
            Akhilesh Singh

            Please attach the sample data or snapshot?

            • 3. Re: Hierarchy (Group more measure into one measure)
              Marko Draskovic

              Hi Akhilesh,

              I have to set the group that weeks are under the month.

              The idea is to have month and to be able to expand it into the weeks.

              Table like this one below.

              The problem for me is that I do not know how to upload the file... If it is possible for you to tell me how and I will upload it.

              Thank you very much!   

              DeptCategoryWeek 27Week 28Week 29Week 30July
              • 4. Re: Hierarchy (Group more measure into one measure)
                Akhilesh Singh

                Hello Marko,


                I have tried by adding one more month data with relative weeks. Refer the below snapshot. If this is what you wanted, please follow my approach. You can expand and collapse the week and month from highlight "-" icon. I have attached the workbook and xls also for better understanding.


                1) You have two type of measures Week and Month. So for week you need to select all weeks by Ctrl Key + mouse click and pivot them as showing in below image. You can rename them as Values and Week.




                2) Month - you need to create a calculated field as below. I have created for July and August. for rest you need to update.

                IF INT(SPLIT([Week],'K',-1))<=4 THEN 'March'

                ELSEIF INT(SPLIT([Week],'K',-1))>=27 AND INT(SPLIT([Week],'K',-1))<=30 THEN 'July'

                ELSEIF INT(SPLIT([Week],'K',-1))>=31 AND INT(SPLIT([Week],'K',-1))<=34 THEN 'August'



                3) Create hierarchy of Month and week.


                After these 3 steps you will have the above view. I hope this could helpful to you. If yes, please mark this as helpful and answered.



                1 of 1 people found this helpful