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

String conditions in a tMap

Hi everyone, I have this two columns. First for the phone, second for the email.

 

I WANT IN A TMAP:

If column PHONE and column EMAIL are NOT NULL = 3

If column PHONE IS NULL and column EMAIL IS NOT NULL = 1

If column PHONE IS NOT NULL and column EMAIL IS NULL = 2

If column PHONE IS NULL and column EMAIL IS NULL = 0

 

 

0695b00000IeE78AAF.png 

In this screenshot would be:

3

1

2

0

 

 

I know to do a condition in a tmap but i dont know to do more than one.

Labels (3)
6 Replies
Mahamoutou
Contributor III
Contributor III

Here is a way to go :

 

0695b00000IeESpAAN.png0695b00000IeESfAAN.png

EvoticTalend
Contributor
Contributor
Author

Hi! Thank you for the response but I tried your code and didn't work... only see 3 in all columns.

Mahamoutou
Contributor III
Contributor III

Please, could you post a capture of your attempt ?

EvoticTalend
Contributor
Contributor
Author

0695b00000IeEtvAAF.png 

0695b00000IeEu0AAF.png 

0695b00000IeEuKAAV.png

Mahamoutou
Contributor III
Contributor III

Thanks for your quick reply.

This problem is probably an "empty string" vs "null value" problem. So I would suggest you to add conditions to handle empty string too. Please, see the screen.

0695b00000IeF3MAAV.png

Anonymous
Not applicable

Hello,

That is really good answer, have you thought of entering our competition?

https://community.talend.com/s/blog/aGn5b000000CaZw/getting-smart-about-talend-tip-of-the-day

There are rewards for winners!

Best regards

Sabrina