Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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.