2 Replies Latest reply on Dec 3, 2015 5:03 AM by Rich Brenton

    Calculating duration based on a event state identifier and timestamp?

    Rich Brenton


      I'd trying to calculate a duration of an event for use in a chart within Tableau.  The database table has a unique event id, but each event id has 2 or more state values (e.g. start of event, change to event, end of event).  I'm trying to calculate the time difference using the timestamp column within the table, where I want to subtract the date/time where state value = 1 from the data/time where state value=0 for each event id.  I've tried the various DATE functions, but to no avail.   Any ideas would be greatly appreciated.