Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have the below scenario.
ID LXD RSF TCO
1 1/12/2014 345 679
2 2/12/2014 678 890
2 3/12/2014 897 890
3 2/4/2014 666 432
3 2/4/2014 760 432
3 2/4/2014 560 666
4 7/4/2014 490 987
4 7/4/2014 490 321
1. I have to get the ID where LXD is the latest date.
2.If LXD is same get the ID based on the highest RSF
3.If LXD AND RSF is same then get the ID based on the highests TCO.
In any scenario I should get the ID only once.So ,my staright table would look like below.
ID LXD RSF TCO
1 1/12/2014 345 679
2 3/12/2014 897 890
3 2/4/2014 760 432
4 7/4/2014 490 987
How can I acheive this ?Thanks much.
I was trying to create a sorting list for the FirstSortedValue()
Look at how the number look in a straighttable to understand each ID will have the max ((LXD*1000000)+(RSF*1000)+TCO) for the places based on the logic provided.
Date most important -> * 1000000
RSF second most important -> *1000
TCO is third most imporant -> * 1
I picked 1000000 and 1000 because the RSF and TCO values both seem to be smaller than 1000. If you multiply RSF by 1000 then it will always be larger than TCO. So if you add RSF and TCO you get a number that can be used to sort by RSF first and TCO second. And if you multiply RSF by 1000 to make sure you get a number that's always larger then TCO then you make LXD a thousand times larger than RSF*1000. So LXD is multiplied by 1000*1000.
ThanK you.... sunindia and gwassenaar .
No problem