Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
its_rajvir
Creator
Creator

General Question

Dear Experts,

Can anyone please help me to get the required result. I have data :

ID Time  SeqNO
12 20:00 34
12 20:45 35
12 20:55 36
12 21:34 37
12 21:47 1
12 21:56 2
13 22:00 43
13 22:14 44
13 22:45 45
14 22:49 23
14 22:51 24
13 23:00 1
13 23:01 2
13 23:02 3
14 23:04 25
14 23:15 26
14 23:20 27

 

From this data i want to get the IDs where the Time is increasing and seqNO is decreasing.

Output should be  

12 21:47 1
13 23:00 1

 

Please help!

Thankyou in advance

1 Reply
justISO
Specialist
Specialist

Hi, you can try something like this:

LOAD 
ID, Time, SeqNO
FROM ...sample...
WHERE SeqNO<previous(SeqNO) and ID=Previous(ID)
ORDER by ID, Time;