Multiple if-else in Expression Field of a column in tmap

Eight Stars

Multiple if-else in Expression Field of a column in tmap

Hi All,
Hope everyone is doing well. 😊
I have a scenario where I have to derive error_code in error_code column of tmap. Value will be like 1,2,3
Scenario is like
Condition1==false?"2":Condition2==null?"1":Column3 less than -1 or column 4 less than -1?"3":"".
I have tested upto "1" which is working fine. Bad data going to Error Table and giving proper Error Code. Can I write multiple If after "1"?
@vboppudi, @rhall_2_0, @TRF

Accepted Solutions
Nine Stars

Re: Multiple if-else in Expression Field of a column in tmap

I think you can write if condition. Are you getting any error?

 

Regards.

Veeru Boppudi
Sixteen Stars

Re: Multiple if-else in Expression Field of a column in tmap

It looks like you have kind of the right idea from your pseudo code, can elaborate on what the issue is?

Thirteen Stars

Re: Multiple if-else in Expression Field of a column in tmap

@abhi90,yes you can use nested if condition in tMap.

Manohar B

All Replies
Nine Stars

Re: Multiple if-else in Expression Field of a column in tmap

I think you can write if condition. Are you getting any error?

 

Regards.

Veeru Boppudi
Sixteen Stars

Re: Multiple if-else in Expression Field of a column in tmap

It looks like you have kind of the right idea from your pseudo code, can elaborate on what the issue is?

Thirteen Stars

Re: Multiple if-else in Expression Field of a column in tmap

@abhi90,yes you can use nested if condition in tMap.

Manohar B
Eight Stars

Re: Multiple if-else in Expression Field of a column in tmap

Yes it's Possible.Thanks for all of your suggestions again Smiley Happy .Marking this Port as resolved. Did below

(Var.v_FLG==false?"2":
row1.ACCOUNT_NAME==null?"1":
Double.parseDouble(row1.column1)<=-1D || Double.parseDouble(row1.column2)<=-0.001 || Integer.parseInt(row1.column3)<=-1 || Integer.parseInt(row1.column4)<=-1 || Integer.parseInt(row1.column5)<=-1 || Integer.parseInt(row1.column6)<=-1 || Integer.parseInt(row1.column7)<=-1 || Integer.parseInt(row1.column8)<=-1 || Integer.parseInt(row1.column9)<=-1 || Integer.parseInt(row1.column10)<=-1 || Integer.parseInt(row1.column11)<=-1 || Integer.parseInt(row1.column12)<=-1?"3":"10")