Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
avner_raz
New Contributor III

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

Tags (2)
1 Solution

Accepted Solutions
Partner
Partner

Re: Flag Max Date

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

Re: Flag Max Date

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

Partner
Partner

Re: Flag Max Date

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

VishalWaghole
Valued Contributor II

Re: Flag Max Date

Hi Anver,

PFA Hope it will help you.

-- Regards,

Vishal Waghole

avner_raz
New Contributor III

Re: Flag Max Date

Thanks

it really helped me