Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hiii Guys,
i want the latest date and latest value of each column.
Thanks in Advance
Load * Inline [
OrderID,Status,Date
1, 0, 01/06/2022 22:01
1, 1, 01/06/2022 23:01
1, 2, 01/06/2022 23:02
2, 0, 01/07/2022 0:01
2, 1, 01/23/2022 5:00
2, 1, 01/07/2022 9:00
3, 0, 01/07/2022 0:01
3, 1, 01/07/2022 0:02
4, 0, 01/07/2022 1:01
4, 1, 01/07/2022 1:03
];
FirstSortedValue(Status,-Num(Date#(Date,'MM/DD/YYYY hh:mm')))
You can use firstsortedvalue function (eg. for Product column Firstsortedvalue(Product,-Date) )
Load * Inline [
OrderID,Status,Date
1, 0, 01/06/2022 22:01
1, 1, 01/06/2022 23:01
1, 2, 01/06/2022 23:02
2, 0, 01/07/2022 0:01
2, 1, 01/23/2022 5:00
2, 1, 01/07/2022 9:00
3, 0, 01/07/2022 0:01
3, 1, 01/07/2022 0:02
4, 0, 01/07/2022 1:01
4, 1, 01/07/2022 1:03
];
FirstSortedValue(Status,-Num(Date#(Date,'MM/DD/YYYY hh:mm')))
Thanks it worked 😊