Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
How can I make sort first by Field1 and then by Field2?
LOAD * INLINE [
Name, DateEntering, DateGraduation
Name1, 01/02/2010, 01/14/2017
Name2, 01/02/2010, 01/15/2017
Name3, 01/01/2010, 01/01/2017
];
I need first sort by DateEntering and then by DateGraduation.
As a result next
Name, DateEntering, DateGraduation
Name3, 01/01/2010, 01/01/2017
Name1, 01/02/2010, 01/14/2017
Name2, 01/02/2010, 01/15/2017
Forgot to add that I need make it in an object properties.
Thx.
Try this:
DateEntering + DateGraduation/1E10
Thank you Sunny, your solution is worked as usual.
Would you please explain why should we divide on this value '1E10'?
Sorting also is working without that.
It is just giving a slight lower weight to the dategraduation. Adding 1e10 will be advisable because there might be a scenario where it might cause issues....top of my head, I can't come up with a scenario, but if you need I can come back and provide one where it might not work....
OK, got it thx.
And one more question pls.
If I need sorting by more than one field I just use '+' sign and add expression.
For second and other fields I add lower weight by using '1E10'
Am I right?
Yes, but if those are lower weighted then DateGraduation, I would divide by 1E11. The max you can can use is 1E14...so you can start accordingly. For example
Field1 + Field2/IE8 + Field3/1E10 + Field4/1E12 + Field5/1E14