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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
vBoniniArt
Contributor II
Contributor II

Show column if two strings are equal

Hi, I have the following problem:

My table looks like this

KEY   NAME   PRODUCT    OLD_ID    NEW_ID      OLD_COUNTRY       NEW_COUNTRY

1        AAA          FFF            2             3                    IT                                 IT

2        BBB         GGG          4              5                     USA                            FR

3       DDD          HHH          6             7                     GB                               ES

 

I would like to see the row blank if the old data is different than the new data:

KEY   NAME   PRODUCT    OLD_ID    NEW_ID      OLD_COUNTRY       NEW_COUNTRY

1        AAA          FFF            2             3                     

2        BBB         GGG          4              5                     USA                            FR

3       DDD          HHH          6             7                     GB                               ES

 

 

I'm using the "show column if" in the column of the table like this (ignore the red, it's an example):    

vBoniniArt_0-1730892523808.png

 

but I still see the data also if they are the same (already trimmed, same type...)

 

What can I do?

12 Replies
Qrishna
Master
Master

if you want hide values when OLD_COUNTRY = NEW_COUNTRY,

use :

Measure1 = if(OLD_COUNTRY<>NEW_COUNTRY, OLD_COUNTRY)
Measure2 = if(OLD_COUNTRY<>NEW_COUNTRY, NEW_COUNTRY)

 

2491092 - Show column if two strings are equal (2).PNG

Qrishna
Master
Master

Data:
Load * Inline [
KEY,NAME,PRODUCT,OLD_ID,NEW_ID,OLD_COUNTRY,NEW_COUNTRY
1,AAA,FFF,2,3,IT, IT
2,BBB,GGG,4,5,USA,FR
3,DDD,HHH,6,7,GB,ES
];

Qualify *;
d:
Load KEY,NAME,PRODUCT,OLD_ID,NEW_ID,
if(OLD_COUNTRY<>NEW_COUNTRY, OLD_COUNTRY) as OLD_COUNTRY,
if(OLD_COUNTRY<>NEW_COUNTRY, NEW_COUNTRY) as NEW_COUNTRY
resident Data;

 

Measure1 = if(OLD_COUNTRY<>NEW_COUNTRY, OLD_COUNTRY)
Measure2 = if(OLD_COUNTRY<>NEW_COUNTRY, NEW_COUNTRY)

 

2491092 - Show column if two strings are equal (2).PNG

 

vBoniniArt
Contributor II
Contributor II
Author

Thank you, this worked!