8 Replies Latest reply on Jun 23, 2016 2:57 PM by Tom W

    DATEDIFF based on a second field (vehicle idles)

    Cheri Beckman

      I want to create a bar or gantt chart showing the duration of all of the idles for a vehicle per day.  I also want to show the Start and End times for each idle in the Tooltips.

       

      Here's how my data is structured (can't change it):

       

      Idle ID    Status      Timetag

      100          F          6/17/16 9:05:14 AM

      100          L          6/17/16 9:25:22 AM

      101          F          6/17/16 11:59:01 AM

      101          L          6/17/16 1:26:00 PM

       

      Status "F" when the Idle starts, and "L" is when the idle ends.  Each Idle event has a unique Idle ID.

       

      I can't seem to get the duration of each Idle -- I know how to use DATEDIFF but I need to make it conditional on the Status and Idle ID fields.

       

      I want TimeTag of Status=F minus Timetag of Status=L only IF the ID for Status "F" equals the ID for Status "L"

       

      I'm not a programmer so I need to be able to do all with Tableau calculations within Tableau Desktop.

       

      Help?