Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Flag first occurrence during load

Hi,

I have a dataset with difference numbers of multiple instances  eg :

   

IDuserDate
1522448MJP01/05/2014
1522448MJP12/08/2014
1522448MJP03/01/2015

There can be anything from 1 instance upto 10 or 12.  In the above example, I need to Flag the record with the Date of 01/05/2014 as being the First record using the ID and User as being the same.

Any help appreciated.

Tom

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

In the script;

Tab:
LOAD * Inline [
ID, user, Date
1522448, MJP, 01/05/2014
1522448, MJP, 12/08/2014
1522448, MJP, 03/01/2015
]
;

Left Join
LOAD ID, user, Min(Date) as Date, 1 as myFlag Resident Tab Group By ID, user;
Resident
Tab Group By Customer;

View solution in original post

3 Replies
alexandros17
Partner - Champion III
Partner - Champion III

In the script;

Tab:
LOAD * Inline [
ID, user, Date
1522448, MJP, 01/05/2014
1522448, MJP, 12/08/2014
1522448, MJP, 03/01/2015
]
;

Left Join
LOAD ID, user, Min(Date) as Date, 1 as myFlag Resident Tab Group By ID, user;
Resident
Tab Group By Customer;

Not applicable
Author

perfect thanks!

Anonymous
Not applicable
Author

PFA