Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
DEV4
Contributor III
Contributor III

Help me with the logic for TMAP Please

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

Labels (4)
1 Solution

Accepted Solutions
mani1304
Creator
Creator

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

View solution in original post

2 Replies
mani1304
Creator
Creator

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

DEV4
Contributor III
Contributor III
Author

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.