Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Borges
Contributor
Contributor

Compare Columns - Function Above

Hello,

 

I have 2 columns that I need to compare. Like below.

CodeDate
113084701/11/2019 00:14:45
113084901/11/2019 00:33:56
113085101/11/2019 01:12:11
113085201/11/2019 01:23:00
113085301/11/2019 01:32:23
113085601/11/2019 01:32:25
113085501/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.

Labels (3)
3 Replies
sergio0592
Specialist III
Specialist III

Hi,

What do you mean with " which codes were served out of order". What is the expected output?

jonathandienst
Partner - Champion III
Partner - Champion III

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. 

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Brett_Bleess
Former Employee
Former Employee

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

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.