2 Replies Latest reply on Dec 18, 2016 9:37 PM by Mahfooj Khan

    TimeLine Graph in Tableau

    ahmad.awad

      Hello,

      I am trying to create a graph in tableau that shows timeline for activities

      I have the following table

         

      TimeEventeventID
      8:00 AMDevice Started0
      8:05 AMQuality Check Started1
      8:09 AMQuality Check End1
      8:15 AMAntivirus Program Started2
      8:20 AMCustom Scan For Virus in C Drive Started3
      8:25 AMstart cleaning virus $54Gop4
      8:26 AMstart cleaning virus ZXrr009i5
      8:30 AMCustom Scan For Virus in C Drive End3
      8:35 AMend cleaning virus ZXrr009i5
      8:39 AMAntivirus Program End2
      9:00 AMend cleaning virus $54Gop4
      9:20 AMDevice Shutdown0

      it is attached as an excel sheet as well

       

      I have created a poor looking image of how i want my graph to look like.

      Image is attached

       

      if this is doable in tableau, could please show me how?

      if not, or if it is hard to do, is there other way I should I be organizing my Table that can make easy to create such a graph?

        • 1. Re: TimeLine Graph in Tableau
          Shinichiro Murakami

          Hi Ahmad

           

          You can draw this type of chart by "Gantt", and that needs start point info and duration as "size".

          In this case, you need to specify, event Name(or ID) and Start/End.

          If you can do that in original data source, that's the best.

          <==  Actually I realized later you have event ID, you can use ID instead of name, But because excel did not have ID column, I created this one.

            

          TimeEventStart / EndEvent Name
          8:00 AMDevice StartedStartDevice
          8:05 AMQuality Check StartedStartQuality Check
          8:09 AMQuality Check EndEndQuality Check
          8:15 AMAntivirus Program StartedStartAntivirus Program
          8:20 AMCustom Scan For Virus in C Drive StartedStartCustom Scan For Virus in C Drive
          8:25 AMstart cleaning virus $54GopStartcleaning virus $54Gop
          8:26 AMstart cleaning virus ZXrr009iStartcleaning virus ZXrr009i
          8:30 AMCustom Scan For Virus in C Drive EndEndCustom Scan For Virus in C Drive
          8:35 AMend cleaning virus ZXrr009iEndcleaning virus ZXrr009i
          9:00 AMend cleaning virus $54GopEndcleaning virus $54Gop

           

          If not, in Tableau, the conversion formula looks like below based on given info.

           

          [Start or End]

          if contains([Event],"start") or contains([Event],"Started") then "Start"

          elseif contains([Event],"end") or contains([Event],"Ended") then "End" end

          Then, need to re-calculate start and end time respectively.

           

          [Event Name]   <==  Actually I realized later you have event ID, you can use ID instead of name, But because excel did not have ID column, I created this one.

          replace(replace(replace(replace(replace([Event],"end ",""),"End",""),"started",""),"start ",""),"Start","")

           

          [Time Start]

          if [Start or End]="Start" then [Time] end

           

          [Time End]

          if [Start or End]="End" then [Time] end

           

          Then Time duration for each [Event Name]

           

          [Time duration]

          {fixed [Event Name]:min(if [Start or End]="End" then [Time] end)}

          -

          {fixed [Event Name]:min(if [Start or End]="Start" then [Time] end)}

           

           

           

           

           

           

           

           

          Thanks,

          Shin

          1 of 1 people found this helpful
          • 2. Re: TimeLine Graph in Tableau
            Mahfooj Khan

            Hi Awad,

             

            Yeah this can be done in tableau. Connect your data in tableau and drag your field like that,

            Note: format your time field to h:nn AMPM and make to continuous

            Let me know If this help.

             

            Mahfooj

            3 of 3 people found this helpful