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

Max Multiple Criteria in Load Script

Dear All,

I have the following data set:

IDOfficeIDDateTimeTimeStampTimeDiffNextMax in 36h
113/03/20209:28:353/03/2020 9:285:37:5917:21:11
113/03/202015:06:343/03/2020 15:0617:21:1117:21:11
114/03/20208:27:454/03/2020 8:279:09:1638:10:41
114/03/202017:37:014/03/2020 17:370:52:3238:10:41
114/03/202018:29:334/03/2020 18:2938:10:4138:10:41
126/03/20208:40:146/03/2020 8:400:05:1464:11:01
126/03/20208:45:286/03/2020 8:453:54:5764:11:01
126/03/202012:40:256/03/2020 12:404:29:0964:11:01
126/03/202017:09:346/03/2020 17:0964:11:0164:11:01
119/03/20209:20:359/03/2020 9:200:07:1721:20:16
119/03/20209:27:529/03/2020 9:272:45:0121:20:16
119/03/202012:12:539/03/2020 12:1221:20:1621:20:16
1110/03/20209:33:0910/03/2020 9:330:00:0237:28:28
1110/03/20209:33:1110/03/2020 9:333:48:3037:28:28
1110/03/202013:21:4110/03/2020 13:215:40:2037:28:28
1110/03/202019:02:0110/03/2020 19:0237:28:2837:28:28

 

I would like to add the blue column which is the maximum of the column "TimeDiffNext"
under the following conditions for the range:
- The same EmployeeID
- The same OfficeID
- TimeStamp Field >= Current TimeStamp -18h
- TimeStamp Field <= Current TimeStamp +18h

Could you please help,
Kind regards,
Yorick Stevens

Labels (3)
1 Solution

Accepted Solutions
lorenzoconforti
Specialist II
Specialist II

See attached; let me know if you want me to explain how it all works

MaxMultipleCriteria.png

View solution in original post

3 Replies
lorenzoconforti
Specialist II
Specialist II

Hi

Trying to understand what you are trying to achieve. How is this the max of any period? 38:10:41

How many rows you need to go through? How big is your table?

Yorick_Stevens
Partner - Contributor III
Partner - Contributor III
Author

Thanks for the swift reply,

Apparently their is an error in my formatting i'm very sorry.
I've just adapted it. The table varies between 200k and 500k of records.

Kind Regards,
Yorick Stevens

lorenzoconforti
Specialist II
Specialist II

See attached; let me know if you want me to explain how it all works

MaxMultipleCriteria.png