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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to use If and Set in Talend

Hi Folks,

 

I am new to Talend.

 

I am looking for functionality to execute the workflow.

Here is what I need,

If my input variable 1 is 'Usage' and my input variable 2 is blank then I want to set Input variable 2 as 'String'

 

How to achieve this?

 

Regards,

Deepak

Labels (2)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

Hi,

In tMap, you may try this expression on the output side for the field associated to "variable2":

 

row1.variable1 != null && 
row1.variable1.equalsIgnoreCase("Usage") && 
(row1.variable2 == null || row1.variable2.equals("")) ? "String" : row1.variable2

Hope this helps.

 

View solution in original post

3 Replies
TRF
Champion II
Champion II

Hi,

In tMap, you may try this expression on the output side for the field associated to "variable2":

 

row1.variable1 != null && 
row1.variable1.equalsIgnoreCase("Usage") && 
(row1.variable2 == null || row1.variable2.equals("")) ? "String" : row1.variable2

Hope this helps.

 

Anonymous
Not applicable
Author

Thanks it worked 0683p000009MACn.png

TRF
Champion II
Champion II

Great!
Don't forget to mark this case as solved (Kudos also accepted).