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: 
Rick21
Contributor
Contributor

How to check the value in the both dimension by the expression?

Rick21_0-1658944594683.png

I have two dimensions. I want to check if the value of the B dimension in the A dimension return same value, or return Null. The picture below is my expected output.

Rick21_2-1658944760761.png

So, my expression is if(B=A, B, Null()), but the output I get is the image below. How can I do to achieve my expected output?

Rick21_3-1658944865909.png

 

Labels (1)
2 Replies
sidhiq91
Specialist II
Specialist II

@Rick21  Please find below the script that I used in the Load Editor. 

NoConcatenate
Temp1:
Load * Inline [
A,
Apple,
Cat,
Orange,
];

Mapping Load
*,
'Present' as Flag
Resident Temp1;

NoConcatenate
Temp:
Load A,
Applymap('Temp1',A,null()) as Condition

Inline [
A
Apple,
Cat,
Dog,
Bird,
Pear
];

NoConcatenate
Temp2:
Load A,
if(Condition='Present',A,Null()) as Condition
Resident Temp;
Drop table Temp, Temp1;

exit script;

If this resolves your issue, please like and accept it as a solution.

 

ASEDavidSu
Contributor III
Contributor III

Hello,

Here's my solving solution. You can take it for an example. 

NEW.PNGNEW2.PNG