Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Community
This is how my source data looks like -
Vin_No | Inv_Date | Mileage_In |
123 | 3/17/2017 | 15000 |
123 | 2/17/2017 | 12000 |
123 | 1/17/2017 | 10000 |
234 | 3/17/2017 | 15000 |
234 | 2/17/2017 | 12000 |
234 | 1/17/2017 | 10000 |
Issue - I want to fetch only the records pertaining to the latest two Inv_dates wrt to the vin_no, sorted by Inv_Date.
****E.g; In my qvw I only want the records highlighted in Red****
Your ideas will be greatly appreciated.
Thanks!
Sneh
May be try this
Table:
LOAD * INLINE [
Vin_No, Inv_Date, Mileage_In
123, 3/17/2017, 15000
123, 2/17/2017, 12000
123, 1/17/2017, 10000
234, 3/17/2017, 15000
234, 2/17/2017, 12000
234, 1/17/2017, 10000
];
FinalTable:
NoConcatenate
LOAD *
Resident Table
Where Vin_No <> Previous(Previous(Vin_No))
Order By Vin_No, Inv_Date desc;
DROP Table Table;
Hi,
use firstsortedValue(field,-date)
for more details see example in help menu
Regards,
May be try this
Table:
LOAD * INLINE [
Vin_No, Inv_Date, Mileage_In
123, 3/17/2017, 15000
123, 2/17/2017, 12000
123, 1/17/2017, 10000
234, 3/17/2017, 15000
234, 2/17/2017, 12000
234, 1/17/2017, 10000
];
FinalTable:
NoConcatenate
LOAD *
Resident Table
Where Vin_No <> Previous(Previous(Vin_No))
Order By Vin_No, Inv_Date desc;
DROP Table Table;