This field is required.
Only these extensions are allowed(.jpg, .JPG, .jpeg, .JPEG, .gif, .GIF, .png, .PNG)
Tags cannot contain the characters ' /, \\, #, ?, or ; >,< '
Only these extensions are allowed(.zip,.ZIP,.pdf,.PDF,.qvf,.QVF,.qvw,.QVW)
Discussion Board for collaboration related to QlikView App Development.
I need to create a flag. The flag must be the earliest date, where the status is AAA.
I am not sure how to get this to work in a load statement, to look like this:
Your example flags each row where the status is AAA regardless of date.
The earliest date with the status AAA would just flag the first row.
Is this correct?
Or do you want the earliest date for each ID where the status is AAA?
Can you clarify with better example data?
The earliest for each status. Apologies for that.
Exactly this: "Or do you want the earliest date for each ID where the status is AAA"
try like below
Load min(Date) as min_date from table1;
Load ID,'1' as flag from table1
Load * from table1;
Load ID,flag from temp;
drop table temp;
Load Status,'1' as flag from table1
Load Status,flag from temp;
Thank you for the replies.
However I need the ID's first date with status AAA.
Taking the min date will return ID 222 date 2017/01/02
This status is not AAA.
Try 2nd solution
1: find min date
2: on the basis of min date I am taking only status.
3: then using status, I am Left join flag field to main table.
Thanks for your reply again.
I think it should be the other way,
1. Find status
2. Find min(date) of status
3. Create flag.
I have attached a more complex example. The status needs to be either AAA or DDD. And I need to flag the very first time the ID fell into one of these statuses.
I need to create the flag in the load. If we look at the list going down. The flagged IDs/Dates and Statuses should be:
Thank you for your responses so far.
What is your required output???
If I could get this I would be happy: