Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Sai33
Partner - Creator
Partner - Creator

First Sorted Value in Load Script doesn't work

Hello All,

I've a requirement to Compare the newest Values of a filed based on the Newest Value of another field. I've used FirstSortedValue() function to do similar stuff for another requirement. But, here the function doesn't seem to work.

Raw Data:

IDEvent TimeProduction Date
BW9666113.02.2019 10:56:3613.02.2019
BW9666113.02.2019 10:57:1913.02.2019
BW9666113.02.2019 10:58:2013.02.2019
BW9666113.02.2019 11:02:2513.02.2019
BW9666113.02.2019 13:56:2613.02.2019
BW9666113.02.2019 13:56:2713.02.2019
BW9666113.02.2019 14:38:1113.02.2019
BW9666113.02.2019 14:55:2413.02.2019
BW9666115.02.2019 12:05:3813.02.2019
BW9666122.02.2019 10:41:4113.02.2019
BW9666121.03.2019 01:55:2513.02.2019
BW9666126.03.2019 11:23:1513.02.2019
BW9666130.05.2019 03:15:5513.02.2019
BW9666130.05.2019 03:16:0613.02.2019
BW9666101.06.2019 23:57:2213.02.2019
BW9666126.06.2019 08:50:3814.02.2019

 

Expected Result:

IDProduction Date
BW9666114.02.2019

 

Have attached the sample Excel Table and also QVD file.

 

Thanks

Sai

Labels (1)
1 Reply
Taoufiq_Zarra

Maye be :

Data:
LOAD * INLINE [
    ID, Event Time, Production Date
    BW96661, 13.02.2019 10:56:36, 13.02.2019
    BW96661, 13.02.2019 10:57:19, 13.02.2019
    BW96661, 13.02.2019 10:58:20, 13.02.2019
    BW96661, 13.02.2019 11:02:25, 13.02.2019
    BW96661, 13.02.2019 13:56:26, 13.02.2019
    BW96661, 13.02.2019 13:56:27, 13.02.2019
    BW96661, 13.02.2019 14:38:11, 13.02.2019
    BW96661, 13.02.2019 14:55:24, 13.02.2019
    BW96661, 15.02.2019 12:05:38, 13.02.2019
    BW96661, 22.02.2019 10:41:41, 13.02.2019
    BW96661, 21.03.2019 01:55:25, 13.02.2019
    BW96661, 26.03.2019 11:23:15, 13.02.2019
    BW96661, 30.05.2019 03:15:55, 13.02.2019
    BW96661, 30.05.2019 03:16:06, 13.02.2019
    BW96661, 01.06.2019 23:57:22, 13.02.2019
    BW96661, 26.06.2019 08:50:38, 14.02.2019
];

FirstSort:
noconcatenate

load ID,FirstSortedValue([Production Date],-Timestamp#([Event Time],'DD.MM.YYYY h:mm:ss')) as [Production Date] resident Data group by ID;

Drop Table Data;

 

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉