Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Team,
@Richard Hall @Shicong Hong @Customer Helpline
The input file is csv. I would like to achieve this certain condition in Talend,
If this number come in the data of a column , it should result in the output as "ACTIVE" & "INACTIVE"
1,2,5,6,B,F = " ACTIVE"
3,4,7,8,9,A,C,D, E,Z = " INACTIVE"
Thanks in advance. Please advice us with clear example.
@Aiming Chen
Your answer works brilliantly !! * only when the data fixed with the numbers I specify. But I get sequence of numbers which I need to make active and inactive for those specific numbers alone, rest need to be collected as it is.
But what if I get a value 10, in that case , it gives a wrong data like inactive for it.
I use the treplace component to specify for the numbers with the ACTIVE & INACTIVE , so I can collect the rest of data as well.
for ex:
Name Code
Prabuj ACTIVE ( 1)
KEVIN ACTIVE (2)
ARANYA INACTIVE (7)
JACK 10
Thank you so much for the code between, it help for the other requirement.
Hello @Prabhakaran Rajendran ,
can you try the below expression if it match your requirement?
input_row.contains("B") || input_row.contains("F")? "ACTIVE": "INACTIVE"
if it doesn't help, please provide more details about requirements, thanks
The input data must be one of the value of the list "1,2,5,6,B,F,3,4,7,8,9,A,C,D, E,Z" or it could be any a value including empty value and null?
@Aiming Chen
Your answer works brilliantly !! * only when the data fixed with the numbers I specify. But I get sequence of numbers which I need to make active and inactive for those specific numbers alone, rest need to be collected as it is.
But what if I get a value 10, in that case , it gives a wrong data like inactive for it.
I use the treplace component to specify for the numbers with the ACTIVE & INACTIVE , so I can collect the rest of data as well.
for ex:
Name Code
Prabuj ACTIVE ( 1)
KEVIN ACTIVE (2)
ARANYA INACTIVE (7)
JACK 10
Thank you so much for the code between, it help for the other requirement.
@Shicong Hong it could have the empty value and other numbers as well. So I use the treplace components to specify the list of "ACTIVE" & "INACTIVE" , and collect the rest.
Solved !
Thank you so much for the efforts.