Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
rexhina
Contributor II
Contributor II

Compare one column with multiple columns (function)

I have a table like below. What I want to do is to compare the first column with  all the other columns if there is any match. In case there is I want to print true, or if not false. I have tried many formulas like:

if(match(column1,column2,colum3,colum4),'true', 'false') 

also like :

if (column1=column2 or column1=colum3 or colum1=colum4,'true', 'false')

but I am not taking the right result, which it should be  true for  first and third row and false for the second one.

colum1 column2 column3 column4
24.01.2022 14.12.2021 24.01.2022  
31.01.2022     5.01.2021
6.02.2022 1.01.2022 6.02.2022 5.02.2022
Labels (6)
2 Replies
Vegar
MVP
MVP

you are comparing dates. Could it be that the underlying  numericals can differ even if the dates are the same. 

Both date(now()) and date(today ()) will return the same string value, but they will not return true when compared as the first will contain a decimal value and the second will be an integer.

have you tried this comparison?

if (floor(column1)=floor(column2) or floor(column1)= floor(colum3) or floor( colum1)=floor(colum4),'true', 'false')

rexhina
Contributor II
Contributor II
Author

I tried the problem it is not with the floor , the problem is that IF OR in Qlik sense does not gives the same result  if I use it in excel. in excel formula returns the right result , well in Qlik is returning all true , I am not finding the right way for it  when logically it should work.