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

IF statments for Groups

Hello everyone,

I have the following table in the code snippet it's the second_load,

Name Status Start End
Tiger release 07.06.2022 17.06.2022
Tiger rejected 07.06.2022 13.06.2022
Fish release 12.05.2022 22.05.2022
Frog release 07.04.2022 12.04.2022
Frog rejected 07.04.2022 10.04.2022

 

 

 

 

Frist_Load:
Load 
Name,
Status,
Date(max(End)) as End,
Date(min(Start)) as Start
Resident Final  Group by Name, Status;

Second_Load:
NoConcatenate
Load
Name,
Status,
Start,
Ende

 
Resident Frist_Load;
Drop Table Frist_Load;

 

 

 

  What i want to achieve is ; To Group the same animal name and if in this group there is a status rejected, calucate the duration with the start date of the rejected until the end point of the released row. Else there is no status  rejected within the name groups calculate the duration end-start. 

 

How would you code this problem in Qliksense ?
Thanks in advance for your time and help 

Labels (1)
2 Replies
MarcoWedel

do you want to calculate in the front end or the script?

what would your expected result be using your sample data?

Loeckli
Contributor III
Contributor III
Author

What is best suited, what is my absolute end goal with this data. Is a graph, on the X-axis the calendar weeks in which the end date lies and on the Y-axis the average lead time of all name groups.

Name Duration Enddate CW
Tiger 10 days 17.06.2022 24 CW 2022
Fish 10 days 22.05.2022  22 CW 2022
Frog 5 days 12.04.2022 15 CW 2022