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

Adding a flag to the earliest action for each case

Hi

Wondering if you can help, i have some data in the format of the table below. I need to add a flag (flag must be a 1 not a date) to the earliest closure record of each case

Can anyone think of the best approach? I am adding the flag through a resident load which is joined back to the original table. I'm not sure whether i need to write a loop to look at all records under each case id, if so i'd appreciate some guidence on that. Thank you in advance

Case IDStatusStatus Date
001Closed01/02/2014
001Closed01/03/2014
001Closed03/03/2014
2 Replies
gmarshall
Partner - Contributor II
Partner - Contributor II

I recon you are on the right track Ashley.

Worked example should clarify / confirm - see attached data & QVW. Note that my data will also show that should there be multipe records for a single case with the same Close Date then both will be flagged.

Let me know how you get on.

Geoff

MarcoWedel

Hi,

one solution:

QlikCommunity_Thread_130144_Pic1.JPG.jpg

table1:

LOAD *

FROM [http://community.qlik.com/thread/130144]

(html, codepage is 1252, embedded labels, table is @1);

Left Join (table1)

LOAD *, 1 as flag;

LOAD [Case ID], Status, Min([Status Date]) as [Status Date]

Resident table1

Where Status = 'Closed'

Group By [Case ID], Status;

hope this helps

regards

Marco