Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jyothish8807
Master II
Master II

Comparing two coloums

hi..

i want to compare two columns in a staright table and give an output as "YES" if both the strings in the column are matched and "NO" if not matched.

when iam using if(col1=col2,'yes','no') col1's all data is compared with 1st element of col2 and again all data of col1 is compared with col2 data.How can i avoid this???

Best Regards,
KC
1 Solution

Accepted Solutions
Not applicable

hi

use recno() or rowno() functions

in your script

LOAD id,

     a,

     b, RowNo() as r

FROM

(ooxml, embedded labels, table is Sheet1);

then instraigh table --

if(a=b,'yes','no')

View solution in original post

9 Replies
Not applicable

hi

use recno() or rowno() functions

in your script

LOAD id,

     a,

     b, RowNo() as r

FROM

(ooxml, embedded labels, table is Sheet1);

then instraigh table --

if(a=b,'yes','no')

kumarnatarajan
Partner - Specialist
Partner - Specialist

Hi,

Please find the attached file,

Ex:

if(Column(1)=Column(2),'Yes','No')

jyothish8807
Master II
Master II
Author

Can u plz explain me how to use rowno() properly.

i want to compare tag1 and tag2 and both columns are from different sheet.

Best Regards,
KC
Not applicable

Hi,

Using,

if(col1=col2,'yes','no')

I am getting the required output as "Yes" or "No" at my end.

Regards,

Snehal Nabar

alexandros17
Partner - Champion III
Partner - Champion III

Here is an example, hope it helps.

jyothish8807
Master II
Master II
Author

iam taking two coloumns from two different sheets in that case all data of ist column is compared with first element of 2nd column. which i dont want. i want to solve this issue.

Best Regards,
KC
jyothish8807
Master II
Master II
Author

Thanxxxxxx

Best Regards,
KC
alexandros17
Partner - Champion III
Partner - Champion III

 

So You have two different tables each one with a column and you want to compare the columns.

 

This is not possible until you link the tables togheter, send me the source tables, I'll try to help.

 

Bye

Alessandro

Not applicable

hi

sorry for late reply.

rowno()

Returns the number of the current row within the current column segment in a table or, in the case of bitmap charts, within the chart's straight table equivalent. The first row is number 1.

in  your script after field name we write rowno() function then it count first row as 1.

please see the attachement.