first of all if you need to use mapping table then the first column should have unique values
in your case OPP_NUM contains 222222 in more than one row but the applymap will return always the first value
suppose your original table is called T1 then your script should be something like this
load *, if([Product Family] = 'WW', OPP_NUM) as WW_OPP_NUM
,if([Product Family] <> 'WW' ,OPP_NUM) as NON_WW_OPP_NUM
drop table T1;
if( isnull(ApplyMap('mappingtable1',OPP_NUM,Null())),'N','Y') AS Cross_Sell
drop table T2;
hope this helps
NOTE: IOT_OPP_NUM doesn't exist and I replaced it with OPP_NUM (I assumed)
!@@ ! !
Thanks for your help.
Your advise really helped me to move a big step.
However, there is a little condition that still cannot be fulfilled like below:
Those highlighted in red should return 'Y' in Cross_Sell instead of 'N'.
Been struggled for quite a moment but i still cannot get the final result to return as 'Y'.
I attached the qvf.file here.
Hope to get some advise.
IOT_Cross_Sell.qvf 176.0 K