2 Replies Latest reply on Dec 29, 2018 6:55 PM by Paul Wachtler

    Projects with 3 timelines shown as stacked gantt

    Jenna Dulchinos

      Hello

       

      I am trying to create a view where we have each project name listed, and then there are 3 lines shown within each project to represent 3 separate timelines. Is there a way to do this so I can achieve the following structure? A sample workbook is attached. i want to have Project name where the assigned is, timeline in the project column (for example timeline 1, 2, or 3) and then the respective bars going with those timelines for each project.

       

      Image result for tableau project timelines

        • 1. Re: Projects with 3 timelines shown as stacked gantt
          Rodrigo Calloni

          Hello Jenna

           

          I took a look in your workbook but I don't see a date field that contains all dates for the projects (you have separated date fields with only the Start and End dates).

           

          In order to create a timeline you need a field that contains all the datapoints for the timeline.

           

          Also you don't need one date field for each project start. You can do that with the unique date field by using MIN and MAX dates for each project. Those will be your Start and End dates.

           

          That way I suggest you to reshape your dataset so all dates are in one continuous field.

           

          I hope this helps

          Rodrigo

          • 2. Re: Projects with 3 timelines shown as stacked gantt
            Paul Wachtler

            Hi Jenna,

             

            I was able to accomplish what you're looking to do by pivoting your data.  I pivoted all 6 date columns so that you now have a single column for your dates and a column (I'm calling it Date Type) that says what type of date it is (Start 1, Start 2, etc). I put DAY(Date) on the columns shelf (make sure its continuous), Project on Rows, and Date Type next to Project on Rows.  I also put a copy of Date Type on the color shelf.

             

            In this pivoted version, the original duration calculations don't work so I created a new duration calculation like this:

            if [Date Type] = "Start 1" then

            DATEDIFF('day',

            {fixed [Project]: max(if [Date Type] = "Start 1" then [Date] end)},

            {fixed [Project]: max(if [Date Type] = "End 1" then [Date] end)})

             

             

            elseif [Date Type] = "Start 2" then

            DATEDIFF('day',

            {fixed [Project]: max(if [Date Type] = "Start 2" then [Date] end)},

            {fixed [Project]: max(if [Date Type] = "End 2" then [Date] end)})

             

             

            elseif [Date Type] = "Start 3" then

            DATEDIFF('day',

            {fixed [Project]: max(if [Date Type] = "Start 3" then [Date] end)},

            {fixed [Project]: max(if [Date Type] = "End 3" then [Date] end)})

            end

             

            Place duration on size and it'll give you the projects separated by row for each project.

             

            After this, I selected all three End date types on the color legend and hid them.  I also deselected "Show Header" on Date Type on the rows shelf.  Here's the end result:

             

            Screen Shot 2018-12-29 at 9.52.45 PM.png

             

            This is all in the attached workbook.  Let me know if you have any questions.

             

            Best,

            Paul

            1 of 1 people found this helpful