5 Replies Latest reply on Jun 13, 2018 6:31 AM by Zhouyi Zhang

# date time difference continuous

Hello,

I have created start and end date parameters.

I want to calculate the difference in seconds between two subsequent rows.I want it to be a continuous measure.

I want something like that:

```(AVG(DATEDIFF('second',[Start Date],[End Date])) - LOOKUP(AVG(DATEDIFF('second',[Start Date],[End Date])), -1))
```

but it gives me zero of course because datediff gives only one number.

• ###### 1. Re: date time difference continuous

Hi, George

Is it something like this?

ZZ

1 of 1 people found this helpful
• ###### 2. Re: date time difference continuous

Hi Zhouyi Zhang!

Pretty close!

Because I have timestamps which differ by 1 minute , so the result should be a continuous vector with the value 60.

So I changed your field to :

(AVG(DATEDIFF('second',[Start Date],[Timestamp])) -

LOOKUP(AVG(DATEDIFF('second',[Start Date],[Timestamp])), -1))

although I am not using the End Date and I am not sure how it is working!

and it works fine.

Thanks for the help!

ZZ

• ###### 4. Re: date time difference continuous

Of course! Thanks!

• ###### 5. Re: date time difference continuous

cheers,

ZZ