Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi , I need to calculate the Sequence difference to the previous entry for every unique ID
The result is the I am looking for is the added difference coloum
Date | Time | Sequence | ID | Difference | |
2022/10/01 | 07:09 | 166 | 24298574917860142 | ||
2022/10/01 | 07:28 | 167 | 24298574917860142 | 1 | |
2022/10/04 | 06:47 | 168 | 24298574917860142 | 1 | |
2022/10/04 | 07:10 | 169 | 24298574917860142 | 1 | |
2022/10/05 | 06:49 | 172 | 24298574917860142 | 3 | |
2022/10/05 | 07:13 | 173 | 24298574917860142 | 1 | |
2022/10/06 | 06:49 | 176 | 24298574917860142 | 3 | |
2022/10/06 | 07:11 | 177 | 24298574917860142 | 1 | |
2022/10/08 | 07:18 | 180 | 24298574917860142 | 3 | |
2022/10/08 | 07:39 | 181 | 24298574917860142 | 1 | |
2022/10/10 | 06:49 | 182 | 24298574917860142 | 1 | |
2022/10/10 | 07:10 | 183 | 24298574917860142 | 1 | |
2022/10/10 | 07:14 | 184 | 24298574917860142 | 1 |
in load script
Temp:
Load
Date
,Time
,Sequence
,ID
From SomeSource.qvd;
Main:
Load *
,ID-peek(ID) as Difference
Resident Temp
Order by Date,Time,ID ASC;
Drop table Temp;
IF In Chart then
=ID - Above(ID)
in load script
Temp:
Load
Date
,Time
,Sequence
,ID
From SomeSource.qvd;
Main:
Load *
,ID-peek(ID) as Difference
Resident Temp
Order by Date,Time,ID ASC;
Drop table Temp;
IF In Chart then
=ID - Above(ID)
Thank you - I think there was a typo , ID--->Sequence