Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Flag Max Date

Hi All,

I have a table with items and dates it looks like that:

Item no.Date (dd.MM.yyyy)
111101.01.2014
111103.05.2014
111102.07.2014
222204.02.2013
222209.05.2014
222201.07.2014

I wish to add a flag to indicate the max date for each item

appreciate any help

thanks

avner

1 Solution

Accepted Solutions
parthiband
Partner - Creator
Partner - Creator

The script  which Alexandros17 posted is right.

But for your better understanding, it will be much better if u use the below

AAA:

LOAD Item,

          myDate,

          Item&Num(Date) as Key

FROM myTable;

left join (AAA)

LOAD Item&Num(MaxDate) as Key, 1 as Flag;

Load Item,

        Max(myDate) as MaxDate

resident AAA

group by Item;

Drop Field Key;

Thanks,

View solution in original post

4 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Where in the script or in a chart?

In the script do:

AAA:

Select Item, myDate from myTable;

left join

Load Item, Max(myDate) as myFlag resident AAA group by Item;

Let me know

parthiband
Partner - Creator
Partner - Creator

The script  which Alexandros17 posted is right.

But for your better understanding, it will be much better if u use the below

AAA:

LOAD Item,

          myDate,

          Item&Num(Date) as Key

FROM myTable;

left join (AAA)

LOAD Item&Num(MaxDate) as Key, 1 as Flag;

Load Item,

        Max(myDate) as MaxDate

resident AAA

group by Item;

Drop Field Key;

Thanks,

VishalWaghole
Specialist II
Specialist II

Hi Anver,

PFA Hope it will help you.

-- Regards,

Vishal Waghole

Anonymous
Not applicable
Author

Thanks

it really helped me