Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Compare two columns while ignoring zero's

How can I compare the left column to the right column in a qlickview  expression?

i need to find the number in the left column that is equal to the right column (without the leading zeroes)

1.jpg

4 Replies
sunny_talwar

Would it be possible to look at your application instead of looking at these screenshots? Makes it easier to understand what you are trying to do

Chanty4u
MVP
MVP

LOAD

     column1

     column2

     If(Len(Trim(column1)>0 and Len(Trim(column2)=0, 'Old',

          If(Len(Trim(column1)=0 and Len(Trim(column2)>0, 'New',

               If(Len(Trim(column1)>0 and Len(Trim(column2)>0, 'Both')))

FROM

     ....

Kushal_Chawda

Like this?


Data:
LOAD *, if(Column1=Column2,1,0) as EqualColumnFlag;
LOAD *,SubField(Field,' ',1) as Column1,
num(SubField(purgechar(Field,'-'),' ',2)) as Column2   Inline [
Field
1001 000001001 -
1002 000123455 -
1003 000234555 -
1004 000001004 - ]
;

swuehl
MVP
MVP

Seems like you are using a list box with two expressions, and you want to create a list box expression and compare the list box values with the first expression.

The list box field is UIDwithZeros? And your expression is a just referencing another field or using a more complex expression?

I think your expression to compare the values might just look like

= If( UIDWithZeros = YourFirstListBoxExpression, 'Same value', 'Not same')

for example

= If( UIDWithZeros = OtherFieldName, 'Same value', 'Not same')