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: 
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
Master III
Master III

Load

Part,

Firstsortedvalue(Date,-Date) as Date,

Firstsortedvalue(Price,-Date) as Price

from QVD

Group  by Part

View solution in original post

11 Replies
jyothish8807
Master II
Master II

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
Author

Hi,

Load

         Part,

         Price,

         Max(Date) as Date,

from QVD

group by Part;

Not applicable
Author

rawdata:

Load

Part,

Max(DATE) as Date,

Sum(Price)

from QVD

group by Part;

Not applicable
Author

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
Author

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

jyothish8807
Master II
Master II

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
Master III
Master III

Load

Part,

Firstsortedvalue(Date,-Date) as Date,

Firstsortedvalue(Price,-Date) as Price

from QVD

Group  by Part

anbu1984
Master III
Master III

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
Author

Hi anbu,

i think he need top value

i have small doubt

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