Skip to main content
Announcements
Global Transformation Awards submissions are open! SUBMIT YOUR STORY
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Minimum Date And Price

I have created a master qvd of Products. Now, I need to find the minimum date and price on that date for each product.

I can find the first date by doing:

Master:

Load Prod,

        PordDate,

        Price,

        ...

From Source;         

Min:

Load Prod,

        Date(Min(ProdDate), 'DD/MM/YYYY') As FirstDate

Resident Master

Group By Prod;

But tyring to figure out how to get Price as well.

1 Reply
nagaiank
Specialist III
Specialist III

You may use the following script.

Min:

Load Prod

     ,FirstSortedValue(ProdDate,ProdDate) as MinProdDate

     ,FirstSortedValue(Price,ProdDate) as PriceAtMinDate

     Resident Master Group By Prod;

This will work if the Minimum of ProdDate is not repeating for any Prod, as FirstSortedValue() function will fail in that case.