Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
stonecold111
Creator III
Creator III

Mapping load with multiple values

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

 

1 Solution

Accepted Solutions
Taoufiq_Zarra

@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:

Taoufiq_Zarra_0-1614167576996.png

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

6 Replies
stonecold111
Creator III
Creator III
Author

Mail is at different occurances . sometimes it's at first, sometims 2nd or 3rd position.

@

stonecold111
Creator III
Creator III
Author

Taoufiq_Zarra

@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:

Taoufiq_Zarra_0-1614167576996.png

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
stonecold111
Creator III
Creator III
Author

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..

Taoufiq_Zarra

if you you have alway one row with @  you don't need all these count

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
stonecold111
Creator III
Creator III
Author

Ok thanks