Filter by multiple column (String) values in tmap

Five Stars

Filter by multiple column (String) values in tmap

How can I filter by used two string column values as i need to filter on different values only?

 

for example :

I am using this filter in tmap

(row4.pivot_value.equals(row6.pivot_value))? false:true 

 

after that i am using tfilter to get true values

 

but it gives an error NullPointerException

 

is there any possible way?


Accepted Solutions
Highlighted
Five Stars

Re: Filter by multiple column (String) values in tmap

Hi,

 

this solution will fit with as some times the other columns won't be null. I have figured out a solution but creating a variale in the tmap with this code:

 

(String.valueOf(row5.pivot_value).equals(String.valueOf(row3.new_staus))) ? "0" : "1" 

 

no erros appear and after that I used filter to get the data with "1" only. it works will with me


All Replies
Fifteen Stars TRF
Fifteen Stars

Re: Filter by multiple column (String) values in tmap

Hi,
Did you try this:
(row4.pivot_value != null && row6.pivot_value != null && row4.pivot_value.equals(row6.pivot_value))? false:true

This is your responsability to decide how to consider null values. Here, the result will be false only when both fiels are not null and equal to each other. Else the result will be false.

TRF
Highlighted
Five Stars

Re: Filter by multiple column (String) values in tmap

Hi,

 

this solution will fit with as some times the other columns won't be null. I have figured out a solution but creating a variale in the tmap with this code:

 

(String.valueOf(row5.pivot_value).equals(String.valueOf(row3.new_staus))) ? "0" : "1" 

 

no erros appear and after that I used filter to get the data with "1" only. it works will with me

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download