Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi qlikss,
I have mapping table with multiple values.
Mapping table:
Key. Mail
100. Sri@gmail.com
100. 999-6667-778
100. 6785-889-888
200. 998- 5466-766
200. John@gmail.com
Applyma p(table,key)
How can I get only mail IDs in applymap when multiple values are there in mapping table
@stonecold111 you can always use script like :
DataMap:
load * inline [
Key,Mail
5,sdsdsdsd@ss
100,Sri@gmail.com
100,999-6667-778
100,6785-889-888
200,998- 5466-766
200,John@gmail.com
]; left join load Key,count(Mail) as counttmp resident DataMap group by Key;
TmpMap:
load Key,Mail resident DataMap where counttmp>1 and WildMatch(Mail,'*@*')>0;
load Key,Mail resident DataMap where counttmp=1;
drop table DataMap;
Map1:
mapping load * resident TmpMap;
drop table TmpMap;
Data:
load Key1, applymap('Map1',Key1,'ND') as Mail inline [
Key1
100
200
5
];
output:
Mail is at different occurances . sometimes it's at first, sometims 2nd or 3rd position.
@
@stonecold111 you can always use script like :
DataMap:
load * inline [
Key,Mail
5,sdsdsdsd@ss
100,Sri@gmail.com
100,999-6667-778
100,6785-889-888
200,998- 5466-766
200,John@gmail.com
]; left join load Key,count(Mail) as counttmp resident DataMap group by Key;
TmpMap:
load Key,Mail resident DataMap where counttmp>1 and WildMatch(Mail,'*@*')>0;
load Key,Mail resident DataMap where counttmp=1;
drop table DataMap;
Map1:
mapping load * resident TmpMap;
drop table TmpMap;
Data:
load Key1, applymap('Map1',Key1,'ND') as Mail inline [
Key1
100
200
5
];
output:
Just by taking resident load with where condition
As wildmatch(mail,*@*) loads only records that has @ ,then we can join or use applymap.
Do we really need all these count function etc..
if you you have alway one row with @ you don't need all these count
Ok thanks