7 Replies Latest reply on Aug 2, 2018 12:58 PM by swaroop.gantela

    Gantt Chart with 3 measures

    Jenna Dulchinos

      Hi all,

       

      I am working to make one Gantt chart with 3 measures which are durations of time. I have accomplished the view in another workbook but the way the data had to be entered is not going to work - it requires more manual entry than we do now. What I have done here is make some mock data with 3 projects and the three separate timelines i want to show. I created three measures of each phase's duration, and was able to get the view I want with two of them, but cannot figure out how to get the third added to the end of the Gantt bar.

       

      I have attached the 10.5 packaged workbook of this mock data/gantt view (timelinebrainstorm_v10.5) and also attached the workbook where I got the desired view, but the data source shows the alternative data entry that I mentioned we can't do (timelinework_v10.5). I need the data to all be entered on one line, not multiple as shown in the second file.

       

      I want to have one graph where all durations are plotted side by side, so it would be the grey bar, then orange, then blue to show the progress of the project timelines. Any thoughts on how to get this third measure included?

       

      Thanks in advance!

        • 1. Re: Gantt Chart with 3 measures
          swaroop.gantela

          Jenna,


          I think it is doable, but it uses the procedure of pivoting your columns:

          Pivot Data from Columns to Rows

           

          This can be done in Tableau Prep or in Tableau Desktop (for certain datasource types).

          This pivoting is a one-time deal. The Prep pivot cannot as yet be scheduled.

           

          Those caveats aside, just wanted to describe the method which maybe can give ideas.

          Basically, we fix the start and end times to the Project, calculate the durations,

          and then plot the respective durations on the Gantt.

           

           

          If it is not possible to Pivot your data, there is an alternative method

          that uses a support table:

          Vizible Difference: Turning Measure Names into a Dimension

           

          Please see workbook v10.5 attached in the Forum Thread.

           

          277522pivot.png

          • 2. Re: Gantt Chart with 3 measures
            Jenna Dulchinos

            Hi,

             

            Thank you for this! I decided to make some mock data and try to re create this on my own in the way I need the data to be entered, and then to pivot the data. I have run into an issue where the bars are not showing up, only one of them appears. What did you do to get the two others to appear? I have attached the workbook here.

             

            Additionally, when you pivot columns will this cause any issues when updating the data? So if someone were to add a new row to the excel sheet, and then I refresh the data in tableau, will I need to "re-pivot" the columns? Or will it automatically know how to update it?

             

            Thanks!

            • 3. Re: Gantt Chart with 3 measures
              swaroop.gantela

              Jenna,

               

              With regards to the bars, I think it was just an issue of

              mismatch between the upper and lower case names.

              To avoid this, it may be best to do all such comparisons

              by converting the string to lower:

              IF LOWER([Date Type])="cp start" THEN [cp duration]

              ELSEIF LOWER([Date Type])="changed start" THEN [changed duration]

              ELSEIF LOWER([Date Type])="execution start" THEN [execution duration]

              END

               

              Likewise with would suggest using LOWER() in the duration calculations.

               

               

              I stand corrected with regards to the pivoting and refreshing.

              I tried it out with a simple example:

              -pivoted the columns in Tableau

              -added new rows in Excel

              -Tableau seemed to update appropriately

               

              You can try it out with the test twb and datafile attached.

               

              So I don't think you will need to do anything but refresh.

              • 4. Re: Gantt Chart with 3 measures
                Jenna Dulchinos

                So I added this in my original workbook and played around with data, it updated accordingly.

                 

                The issue I am running into it when I pivot the data is that the names get replicated.. so as shown in the attached workbook when you hover over items on the main dashboard it is showing the number of records to be multiples of the actual number. there are only ~140 rows in the data source but the pivot is making it show more... any thoughts on a way to exclude duplicated name values? Or maybe the pivot function just will not work for what I need..

                • 5. Re: Gantt Chart with 3 measures
                  swaroop.gantela

                  Jenna,

                   

                  Yes, the pivot does create an extra copy of

                  the Name for each column that is pivoted.

                   

                  This can be accounted for making a calculated

                  field of a Count Distinct of whatever Dimension

                  uniquely defines each row in your true data source.

                   

                  In this particular case, instead of using SUM([Number of Records]),

                  you could use COUNTD([Name]).

                   

                  I demonstrate this on the CP Phase Chart of the

                  workbook attached in the Forum Thread.

                   

                  I didn't look at the other graphs, but they will likely

                  require the same COUNTD of Names, or whatever

                  other Dimension they are plotting.

                  • 6. Re: Gantt Chart with 3 measures
                    Jenna Dulchinos

                    Great, thank you for all of your help!

                    • 7. Re: Gantt Chart with 3 measures
                      swaroop.gantela

                      Jenna,

                       

                      Glad that was helpful.

                      All the best.