Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
Can you please help me how to achieve the below scenario.I need to write the condition in TMAP.
If Column A =1 and rest of columns B,C,D are 0, then target column should be populated with 'Applicant'.
If Column A and B =1 and rest of columns C,D are 0, then target column should be populated with 'Admit'.
If Column A and B and C =1 and rest of column D IS 0, then target column should be populated with 'Commit'.
If all columns A,B,C,D are = 1, the the target column should be populated with 'Net Commit'.
Thanks
I am assuming A,B,C,D as input column and there is only one output column, which can have the given values, so you can use if condition to assign values to the output column as per the condition and assign null if non match, like below
(input_row.A==1)&&(input_row.B==0)&&(input_row.C==0)&&(input_row.D==0)?"Applicant":
(input_row.A==1)&&(input_row.B==1)&&(input_row.C==0)&&(input_row.D==0)?"Admit":
(input_row.A==1)&&(input_row.B==1)&&(input_row.C==1)&&(input_row.D==0)?"Commit":
(input_row.A==1)&&(input_row.B==1)&&(input_row.C==1)&&(input_row.D==1)?"NetCommit":null
I am assuming A,B,C,D as input column and there is only one output column, which can have the given values, so you can use if condition to assign values to the output column as per the condition and assign null if non match, like below
(input_row.A==1)&&(input_row.B==0)&&(input_row.C==0)&&(input_row.D==0)?"Applicant":
(input_row.A==1)&&(input_row.B==1)&&(input_row.C==0)&&(input_row.D==0)?"Admit":
(input_row.A==1)&&(input_row.B==1)&&(input_row.C==1)&&(input_row.D==0)?"Commit":
(input_row.A==1)&&(input_row.B==1)&&(input_row.C==1)&&(input_row.D==1)?"NetCommit":null
Thank you so much. I just implemented this logic and I was able to achieve my requirement. And yes the target column is only one column.