Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to filter based on multiple condition

Hi there ,

 

I am very new to talend and has very basic question . I am trying to filter rows based on multiple condition . I am not sure how to achieve this ?  I see filter expression in tMap but that allowed me to enter only 1 expression and I have multiple condition . 

 

I  am trying to put Filter condition based on this . Input data is coming from tMSSQLInput .

 1 ,    MarketingTypeID =    row1.TypeItemName.("Marketing")  then give me TypeID  and put value in the column MarketingTypeID

2 ,    PrivacyTypeID =   row1.TypeItemName.("Privacy")  then give me TypeID and put value in the column PrivacyTypeID

 

0683p000009M3WX.png

 

0683p000009M3Wh.png

 

I am sure it is very simple question but I am not sure how to solve this 0683p000009MA9p.png Can some one please help .

 

 

 

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

 

    You have not provided your output schema in your query. But I am assuming its two columns in same schema. Based on that assumption, I have created the logic as shown below.

0683p000009M3Xz.png

 

!Relational.ISNULL(row1.TypeItemName)&& row1.TypeItemName.equals("Marketing")?row1.TypeId:null 

!Relational.ISNULL(row1.TypeItemName)&& row1.TypeItemName.equals("Privacy")?row1.TypeId:null

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

1 Reply
Anonymous
Not applicable
Author

Hi,

 

    You have not provided your output schema in your query. But I am assuming its two columns in same schema. Based on that assumption, I have created the logic as shown below.

0683p000009M3Xz.png

 

!Relational.ISNULL(row1.TypeItemName)&& row1.TypeItemName.equals("Marketing")?row1.TypeId:null 

!Relational.ISNULL(row1.TypeItemName)&& row1.TypeItemName.equals("Privacy")?row1.TypeId:null

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂