Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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):
but I still see the data also if they are the same (already trimmed, same type...)
What can I do?
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)
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)
Thank you, this worked!