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

Display only the latest entries of a Case ID

Hi,

What I require to do is show the workflow of the latest records of a 'Case ID'. In the data if the Stage number is equal to the max  stage then the status will show complete. I have attached the required output.

Sample data:

Case IdentifierCycleStageMax stages in the cycleOverall StatusTime (Days and Hours)SLA Time ScaleSLA.Time
{E075B973-0000-C511-B2FA-0428B188370D}323Pending0 00:46:35Less Than 7 Days05/09/2020 11:28:05 AM
{E075B973-0000-C511-B2FA-0428B188370D}313Pending0Less Than 7 Days05/09/2020 10:41:30 AM
{E075B973-0000-C511-B2FA-0428B188370D}222Complete0 00:46:35Less Than 7 Days05/08/2020 11:28:05 AM
{E075B973-0000-C511-B2FA-0428B188370D}212Pending0Less Than 7 Days05/08/2020 10:41:30 AM
{E075B973-0000-C511-B2FA-0428B188370D}122Complete0 04:24:59Less Than 7 Days04/08/2020 10:38:39 PM
{E075B973-0000-C511-B2FA-0428B188370D}112Pending0Less Than 7 Days04/08/2020 6:13:40 PM
{1234B}123Pending0 04:24:59Less Than 7 Days04/08/2020 10:38:39 PM
{1234B}113Pending0Less Than 7 Days04/08/2020 6:13:40 PM

 

Please provide a solution for the same.

Thanks in advance

Labels (1)
1 Solution

Accepted Solutions
MayilVahanan

Hi @Varun1 

Try like below

Temp:
LOAD * INLINE [
Case Identifier, Cycle, Stage, Max stages in the cycle, Overall Status, Time (Days and Hours), SLA Time Scale, SLA.Time
{E075B973-0000-C511-B2FA-0428B188370D}, 3, 2, 3, Pending, 0 00:46:35, Less Than 7 Days, 05/09/2020 11:28:05 AM
{E075B973-0000-C511-B2FA-0428B188370D}, 3, 1, 3, Pending, 0, Less Than 7 Days, 05/09/2020 10:41:30 AM
{E075B973-0000-C511-B2FA-0428B188370D}, 2, 2, 2, Complete, 0 00:46:35, Less Than 7 Days, 05/08/2020 11:28:05 AM
{E075B973-0000-C511-B2FA-0428B188370D}, 2, 1, 2, Pending, 0, Less Than 7 Days, 05/08/2020 10:41:30 AM
{E075B973-0000-C511-B2FA-0428B188370D}, 1, 2, 2, Complete, 0 04:24:59, Less Than 7 Days, 04/08/2020 10:38:39 PM
{E075B973-0000-C511-B2FA-0428B188370D}, 1, 1, 2, Pending, 0, Less Than 7 Days, 04/08/2020 6:13:40 PM
{1234B}, 1, 2, 3, Pending, 0 04:24:59, Less Than 7 Days, 04/08/2020 10:38:39 PM
{1234B}, 1, 1, 3, Pending, 0, Less Than 7 Days, 04/08/2020 6:13:40 PM
];

Final:

Load [Case Identifier]&'|'& Cycle as Key, * Resident Temp where [Overall Status] = 'Complete';

Concatenate
Load * Resident Temp where not Exists(Key, [Case Identifier]&'|'& Cycle);

DROP Field Key;

DROP Table Temp;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

2 Replies
MayilVahanan

Hi @Varun1 

Try like below

Temp:
LOAD * INLINE [
Case Identifier, Cycle, Stage, Max stages in the cycle, Overall Status, Time (Days and Hours), SLA Time Scale, SLA.Time
{E075B973-0000-C511-B2FA-0428B188370D}, 3, 2, 3, Pending, 0 00:46:35, Less Than 7 Days, 05/09/2020 11:28:05 AM
{E075B973-0000-C511-B2FA-0428B188370D}, 3, 1, 3, Pending, 0, Less Than 7 Days, 05/09/2020 10:41:30 AM
{E075B973-0000-C511-B2FA-0428B188370D}, 2, 2, 2, Complete, 0 00:46:35, Less Than 7 Days, 05/08/2020 11:28:05 AM
{E075B973-0000-C511-B2FA-0428B188370D}, 2, 1, 2, Pending, 0, Less Than 7 Days, 05/08/2020 10:41:30 AM
{E075B973-0000-C511-B2FA-0428B188370D}, 1, 2, 2, Complete, 0 04:24:59, Less Than 7 Days, 04/08/2020 10:38:39 PM
{E075B973-0000-C511-B2FA-0428B188370D}, 1, 1, 2, Pending, 0, Less Than 7 Days, 04/08/2020 6:13:40 PM
{1234B}, 1, 2, 3, Pending, 0 04:24:59, Less Than 7 Days, 04/08/2020 10:38:39 PM
{1234B}, 1, 1, 3, Pending, 0, Less Than 7 Days, 04/08/2020 6:13:40 PM
];

Final:

Load [Case Identifier]&'|'& Cycle as Key, * Resident Temp where [Overall Status] = 'Complete';

Concatenate
Load * Resident Temp where not Exists(Key, [Case Identifier]&'|'& Cycle);

DROP Field Key;

DROP Table Temp;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Varun1
Partner - Contributor III
Partner - Contributor III
Author

Perfect Thanks a ton!!! 😁

Regards,

Varun