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: 
Qliklearner3
Contributor II
Contributor II

If clause with Max

Hi All,

I need to write a load script in qlikview to achieve the max (time) when the if condition is satisfied.

eg- if(ID=1, max(time)) as time but this is not working can anyone guide ?

if ID =1 I need max time when ID=2 I need min time so on..

Table 

ID time

1,02:00:00

1,04:55:00

2,2:50:00

2,03:00:00

QlikView Qlik Sense Business 

 

Labels (2)
2 Replies
anat
Master
Master

test:

load * inline [
ID,time

1,02:00:00

1,04:55:00

2,2:50:00

2,03:00:00
](delimiter is ',');

noconcatenate
test1:
load ID,if(ID=1,time(min(time)),time(max(time))) resident test group by ID ;

exit script;

vchuprina
Specialist
Specialist

Hi,

Check script below:


DATA_TMP:
LOAD * Inline[
ID, time
1,02:00:00
1,04:55:00
2,2:50:00
2,03:00:00
];

DATA:
LOAD

ID,
Timestamp(IF(ID=1, Min(time),
IF(ID = 2, Max(time))), 'hh:mm:ss') AS Time
Resident DATA_TMP
Group By ID;

Regards,

Vitalii

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").