Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I've a requirement to Compare the newest Values of a filed based on the Newest Value of another field. I've used FirstSortedValue() function to do similar stuff for another requirement. But, here the function doesn't seem to work.
Raw Data:
ID | Event Time | Production Date |
BW96661 | 13.02.2019 10:56:36 | 13.02.2019 |
BW96661 | 13.02.2019 10:57:19 | 13.02.2019 |
BW96661 | 13.02.2019 10:58:20 | 13.02.2019 |
BW96661 | 13.02.2019 11:02:25 | 13.02.2019 |
BW96661 | 13.02.2019 13:56:26 | 13.02.2019 |
BW96661 | 13.02.2019 13:56:27 | 13.02.2019 |
BW96661 | 13.02.2019 14:38:11 | 13.02.2019 |
BW96661 | 13.02.2019 14:55:24 | 13.02.2019 |
BW96661 | 15.02.2019 12:05:38 | 13.02.2019 |
BW96661 | 22.02.2019 10:41:41 | 13.02.2019 |
BW96661 | 21.03.2019 01:55:25 | 13.02.2019 |
BW96661 | 26.03.2019 11:23:15 | 13.02.2019 |
BW96661 | 30.05.2019 03:15:55 | 13.02.2019 |
BW96661 | 30.05.2019 03:16:06 | 13.02.2019 |
BW96661 | 01.06.2019 23:57:22 | 13.02.2019 |
BW96661 | 26.06.2019 08:50:38 | 14.02.2019 |
Expected Result:
ID | Production Date |
BW96661 | 14.02.2019 |
Have attached the sample Excel Table and also QVD file.
Thanks
Sai
Maye be :
Data:
LOAD * INLINE [
ID, Event Time, Production Date
BW96661, 13.02.2019 10:56:36, 13.02.2019
BW96661, 13.02.2019 10:57:19, 13.02.2019
BW96661, 13.02.2019 10:58:20, 13.02.2019
BW96661, 13.02.2019 11:02:25, 13.02.2019
BW96661, 13.02.2019 13:56:26, 13.02.2019
BW96661, 13.02.2019 13:56:27, 13.02.2019
BW96661, 13.02.2019 14:38:11, 13.02.2019
BW96661, 13.02.2019 14:55:24, 13.02.2019
BW96661, 15.02.2019 12:05:38, 13.02.2019
BW96661, 22.02.2019 10:41:41, 13.02.2019
BW96661, 21.03.2019 01:55:25, 13.02.2019
BW96661, 26.03.2019 11:23:15, 13.02.2019
BW96661, 30.05.2019 03:15:55, 13.02.2019
BW96661, 30.05.2019 03:16:06, 13.02.2019
BW96661, 01.06.2019 23:57:22, 13.02.2019
BW96661, 26.06.2019 08:50:38, 14.02.2019
];
FirstSort:
noconcatenate
load ID,FirstSortedValue([Production Date],-Timestamp#([Event Time],'DD.MM.YYYY h:mm:ss')) as [Production Date] resident Data group by ID;
Drop Table Data;