Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to compare two fields in expression

Hi i'm kinda new to qlikview and i have this problem. i have two fields from diferrent excel file column and i need to compare them using formula in expression.

Example:

Field1           Field2

Car              Car2

Mazda          Merzedez 

Honda           Honda

Toyota          Hyundai

now i need expression formula for each result, their data similaries and difference.

Result:

Mazda

Merzedez

Toyota

Hyundai

Result:

Honda

Please help me. I'm struggling to find a solution T_T. Thanks in advance,

1 Reply
swuehl
MVP
MVP

You could do it like this in the script:

Field1:

LOAD * INLINE [

Field1

Car

Mazda

Honda

Toyota

];

Field2:

LOAD * INLINE [

Field2

Car2

Merzedez

Honda

Hyundai

];

Result2:

Load

Field2 as Result2 resident Field2 where exists(Field1, Field2);

Result1:

Load Field1 as Result1 resident Field1 where not exists(Field2,Field1);

Load Field2 as Result1 resident Field2 where not exists(Field1,Field2);

Hope this helps,

Stefan