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 ( same values, or did I miss something here?
@iWant2LearnMore,use the below conditions.
row2.test.contains("ABC123") ? "NULL" : row2.test
row2.test.contains("ABC123") ? row2.test : "NULL"
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 | '--------'
@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?
@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"
Introduction to Talend Open Studio for Data Integration.
Practical steps to developing your data integration strategy.
Create systems and workflow to manage clean data ingestion and data transformation.