Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
following questions lets say I have following table:
Facts:
CustomerID CustomerNane Type Flag
1 aaa a Y
2 bbb b N
3 ccc c N
Than I have a mapping date in excel with following structure:
Mapping:
CustomerID CustomerName Flag
1 aaa N
2 bbb Y
So basically I will overwrite the Flag where I have match with the ID but I want to this ONLY FOR "Type" a and b - TYPE 'c' should be not checked...
¨
A simple applymap is not doing that. Could anyone help please?
Regards
Why not, this would work like you described it:
if(Type <> 'c', applymap('Mapping', CustomerID, Flag), Flag) as NewFlag
(a mapping-table had only two fields and need a mapping-qualifier)
- Marcus
Why not, this would work like you described it:
if(Type <> 'c', applymap('Mapping', CustomerID, Flag), Flag) as NewFlag
(a mapping-table had only two fields and need a mapping-qualifier)
- Marcus
Mapping:
Mapping LOAD CustomerID&CustomerName as Key,Flag
Inline
[
CustomerID,CustomerName,Flag
1, aaa, N
2,bbb, Y
];
LOAD CustomerID,CustomerName,Type,
if(Type<>'c',ApplyMap('Mapping',CustomerID&CustomerName,'NA'),Flag) as Flag
Inline
[
CustomerID, CustomerName,Type,Flag
1,aaa,a, Y
2, bbb, b, N
3,ccc,c, N
];
HTH
Sasi