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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditional date

Hi guys,

I have got below inline load:

tab1:

LOAD * INLINE [

ID, Status, Date, Agency

353387956, PDW, 2014-10-03 17:23:04,    257

353387956, PDW, 2014-10-03 20:39:09,    258

353387956, DOR, 2014-10-03 21:37:27,    259

353387956, AWI, 2014-10-03 22:37:27,    260

353387957, PWS, 2014-10-04 09:08:04,    105

353387957, PDW, 2014-10-04 03:38:02,    106

353387957, WZS, 2014-10-04 08:27:49,    106

353387958, PDD, 2014-10-06 06:31:03,    186

353387958, AZPO, 2014-10-07 00:00:01,    187

353387958, DOR, 2014-10-07 15:38:41,    188

];

When ID got statuses 'DOR', 'AZPO' or 'AWI' assigned then I need Agency name with minimum Date assigned to this statuses.

When ID got no statuses 'DOR', 'AZPO' or 'AWI' assigned then I need Agency name with maximum Date.

My final result would be then:

ID, Agency

353387956, 259

353387957, 105

353387958, 187

Thank You very much in advance for help in this case

Sebastian

2 Replies
maxgro
MVP
MVP

see attachment

1.png

Not applicable
Author

Thank You, it is working properly and I could use that solution.

However I have got very big database (billions records) and I am wondering now if there exists more optimal solution, which will go through data only once and would also find correct answer (I think it is possible, but do not know how to code it in qlik).

Thanks Guys for answers!

Sebastian