Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
guya
Contributor II
Contributor II

Compare data expression

Dear all,

I need to compare two data from each order line and add new column saying 'Matched' if the difference is less than 1 and 'NotMatched' if the difference is more dans 1.

eg: if a = 254.23 and b = 254.40 then the new column will show 'Matched'

if a = 135.45 and b = 137 then 'NotMatched'

Is it possible to do this using set analysis or in the script somehow.

Thank you for your support,

Guy

1 Solution

Accepted Solutions
Not applicable

Hello again,

then you need to join (not a SQL-Join but a QV-Join) the correspondending tables temporarily together. Therefor you need a unique matching key. If you don't have it, you are in trouble. The attached sample application points into the right direction. Table1 will get a new field called Match_Col.

Regards Roland

View solution in original post

5 Replies
Not applicable

Hi Guy,

I would do that in the load - script like this:

LOAD . . . IF ( (a - b) < 1, 'Matched', 'NoMatch') AS MATCH_COLUMN; ....


Regards, Roland

guya
Contributor II
Contributor II
Author

The field a & b are located in two different tables. What will be the LOAD synthax?

With many thanks

Guy

Not applicable

Hello again,

then you need to join (not a SQL-Join but a QV-Join) the correspondending tables temporarily together. Therefor you need a unique matching key. If you don't have it, you are in trouble. The attached sample application points into the right direction. Table1 will get a new field called Match_Col.

Regards Roland

guya
Contributor II
Contributor II
Author

Thank you very much Roland - That's works fine Smile

Guy

Not applicable

Hi Guy,

glad to help you. Don't hesitate to post again.

Would you mark my answer as the one which solved the problem, too. Smile

RR