Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have 2 columns that I need to compare. Like below.
Code | Date |
1130847 | 01/11/2019 00:14:45 |
1130849 | 01/11/2019 00:33:56 |
1130851 | 01/11/2019 01:12:11 |
1130852 | 01/11/2019 01:23:00 |
1130853 | 01/11/2019 01:32:23 |
1130856 | 01/11/2019 01:32:25 |
1130855 | 01/11/2019 01:40:46 |
In a normal process, Code and Date should walk together.
I want to identify which codes were served out of order, like the one I colored. Something like above function on qlikview but I need to do that on script code.
Ty for your help.
Hi,
What do you mean with " which codes were served out of order". What is the expected output?
Something like:
LOAD Code,
Date,
If(Date < Previous(Date), 1, 0) as OutOfOrder
Resident
Order By Code;
This assumes that Date is a valid numerical date value. Adjust the field names if necessary to suit your data.
Did Jonty's suggestion get you what you needed? If so, do not forget to return to your thread and properly close it out by using the Accept as Solution button on his post! That will give him credit for the help and let other Members know it worked for you. If you did something different, consider posting that and then mark it to close the thread out.
Regards,
Brett