1 input from a column on tmysqlinput to 2 output

Seven Stars

1 input from a column on tmysqlinput to 2 output

I have a column that I need to extract on 2 parts, which having the same condition if I am right. But, I can't get the right values and what I get is instead of only the values I need, I got all the values from that column. And this is the expression I created.

 

1. The output on row1 in output should be if the values contains ABC123 then "NULL" else just keep the value.  

(String) (row1.ColumnName.contains(%ABC123%) ? "NULL" : row1.columnName.equalsIgnoreCase(row5.ADDRESS)) - i got all in output

 

row1.ColumnName.contains(%ABC123%) ? "NULL" : row1.ColumnName.valueOf(row1.ColumnName) - I got all in output

 

I also tried to use matches same output.

 

2.  The output on row2 in output should be  if the values contains ABC123 then keep it else set to NULL

 

My understanding on expression is that:

 

if condition mets then (?) NULL (Smiley Happy same values, or did I miss something here?

 

 

 

 

Tags (1)
Forteen Stars

Re: 1 input from a column on tmysqlinput to 2 output

@iWant2LearnMore,use the below conditions.

 

row2.test.contains("ABC123") ? "NULL" : row2.test 

 

row2.test.contains("ABC123") ? row2.test  : "NULL" 

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Forteen Stars

Re: 1 input from a column on tmysqlinput to 2 output

hi,

 

you are use wrong syntax:

for contain - you do not need %% it is not a SQL, it search for all substring

row1.str.contains("ABC123") ?
null 
: "false" 

next - if you want replace to null, it is null, "NULL" it is string

 

but in any case code from above is work:

.--------.
|tLogRow_1|
|=------=|
|filtered|
|=------=|
|null    |
|false   |
'--------'
-----------
Highlighted
Seven Stars

Re: 1 input from a column on tmysqlinput to 2 output

@vapukov weird, coz I still got the same issue. Maybe because, I'm extracting another data from the same column name. So, that would be 3 process for the 2 types of data that I'm extracting, is that possible?

Forteen Stars

Re: 1 input from a column on tmysqlinput to 2 output

@iWant2LearnMore,you can use the below and the data type should be sting.

 

row2.test.contains("ABC123") ? "NULL" : row2.test1

 

row2.test.contains("ABC123") ? row2.test1  : "NULL" 

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Forteen Stars

Re: 1 input from a column on tmysqlinput to 2 output

@iWant2LearnMore,still do you have this issue?

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

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

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download