Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
We are trying to create a new column in a table1, called Director where Level 6 column has values in the list of Directors column in other table2.
Can anyone please suggest on this.
CHECKTABLE:
MAPPING Load DIRECTOR,Rowno() as rno RESIDENT CHECKTABLE from TABLE2;
TABLE1:
Load Emp, [Level 5],[ Level 6],
if(not applymap('CHECKTABLE',[Level 5],'NA')='NA',[Level 5],
if(not applymap('CHECKTABLE',[Level 6],'NA')='NA',[Level 6],'NA')) as Director
from table 1;
can you share an example?
Hi,
New Column to be created by comparing Level 6 and Level 5 columns with Director column in Table2. Just as an example i have taken 2 values in Table 2 but there are many.
if (Level 6 in Director from table 2, Level 6, if(level 5 in Director from table 2, level5, NA))
this if statement works in SQL, but how to write it in Qliksense.
Table 1 | |||
Emp | Level 5 | Level 6 | New Column |
E01 | ABC | NA | ABC |
E02 | NA | NA | NA |
E03 | NA | XYZ | XYZ |
Table2
Director |
ABC |
XYZ |
Could you please tell me how it can be applied to my example
CHECKTABLE:
MAPPING Load DIRECTOR,Rowno() as rno RESIDENT CHECKTABLE from TABLE2;
TABLE1:
Load Emp, [Level 5],[ Level 6],
if(not applymap('CHECKTABLE',[Level 5],'NA')='NA',[Level 5],
if(not applymap('CHECKTABLE',[Level 6],'NA')='NA',[Level 6],'NA')) as Director
from table 1;
Hello,
You don't even need any Mapping. All you need a simple nested If statement like :
If(
Isnull(level6)=0,
level6,
If(
Isnull(level5)=0,
level5,
'N/A'
)
) as [New Column]
In this New Column you should get your desired results.
Let me know if this worked for you or if you have any queries.
Thank & Regards
Rohan S. Desai
Thanks Asinha!
it is working fine for one column.
Can you please help for creating one more new column called Associate Director and in check table there is another column coaled Associate director.