Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

get max date from qvd

Hi,

I want to pull from  QVD only the max date of each product.

How can I do that? see example below.

Raw Data:

PART  PRICE    DATE

a          10          01/01/2014

a          20          01/01/2015

b          10          01/01/2015

Output:

a          20          01/01/2015

b          10          01/01/2015

Thanks to all,

Jacob

1 Solution

Accepted Solutions
anbu1984
Honored Contributor III

Re: get max date from qvd

Load

Part,

Firstsortedvalue(Date,-Date) as Date,

Firstsortedvalue(Price,-Date) as Price

from QVD

Group  by Part

11 Replies
jyothish8807
Honored Contributor II

Re: get max date from qvd

Hi Jacob,

try like this:

Load

Part,

Max(Date) as Date,

Sum(Price)

from QVD

group by Part;

Regards

KC

Best Regards,
KC
Not applicable

Re: get max date from qvd

Hi,

Load

         Part,

         Price,

         Max(Date) as Date,

from QVD

group by Part;

Not applicable

Re: get max date from qvd

rawdata:

Load

Part,

Max(DATE) as Date,

Sum(Price)

from QVD

group by Part;

Not applicable

Re: get max date from qvd

Thanks for the advice

But I think you got it wrong

I don't want sum of price,I want to get only the row of the last date

Not applicable

Re: get max date from qvd

then put price instead of sum(price) and make sure  field name should be same

jyothish8807
Honored Contributor II

Re: get max date from qvd

Hi Jacob,

Sum(Price) will give you sum for  the customer only. Did you try it? The same row will come as output.

Regards

KC

Best Regards,
KC
anbu1984
Honored Contributor III

Re: get max date from qvd

Load

Part,

Firstsortedvalue(Date,-Date) as Date,

Firstsortedvalue(Price,-Date) as Price

from QVD

Group  by Part

anbu1984
Honored Contributor III

Re: get max date from qvd

Load Part,Firstsortedvalue(Date,-Date) as Date,Firstsortedvalue(Price,-Date) as Price Group by Part;

Load * Inline [

Part,Price,Date

a,10,01/01/2014

a,20,01/01/2015

b,10,01/01/2015 ];

Not applicable

Re: get max date from qvd

Hi anbu,

i think he need top value

i have small doubt

Firstsortedvalue(Date,-Date) as Date   it gives top or lowest value  ?

Community Browser