Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I'm trying to load "min values" from a table. I have redundant rows but I want only the row's which have the min Amount.
Example:
ID, Amount
1, 5
1, 2
2, 3
2, 8
3, 9
In this Example I want only back...
1,2
2,3
3,9
But I don't know to handle this.
Thank you
Data:
LOAD
ID
DateOne
SETDate
DateTwo,
floor(DateTwo)- floor(DateOne) as Diff,
Amount
FROM table;
New:
LOAD ID,
DateOne,
FirstSortedValue(DateTwo,Diff) as DateTwo,
Firstsortedvalue(Amount,Diff) as Amount
Resident Data
group by ID,DateOne;
drop table Data;