Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

mapping load


I sold this product
item:
Load * Inline [

item,
AZ002
BZcode
LZ253
];

This is the master:

Load * Inline [

item , family
AZ002 , AA
BZcode, AA
LZ253, BB
C130, CC
STG25, DD
PP140, EE
MG250, FF
TR560,FF
];



Now, I woyld to serach in master and to extract the item and the family linked . I qoluld to create a new list box buld JUST the code thath
exists and not all the master table.
I know I qould to create a ma:
mapping load of master
after?

Thanks


Best regrds

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

If you want to use mapping:


ItemFamilyMap:
mappind load distinct
item as A,
family as b
resident master;
...

join (item) load
item,
applymap('ItemFamilyMap', item) as family
resident item;


View solution in original post

3 Replies
Anonymous
Not applicable
Author

If you want to use mapping:


ItemFamilyMap:
mappind load distinct
item as A,
family as b
resident master;
...

join (item) load
item,
applymap('ItemFamilyMap', item) as family
resident item;


Not applicable
Author

Thnks. Yes, it works.

Please if i I put in a Master table an other field called division?

Load * Inline [

item , family, Division
AZ002 , AA , line
BZcode, AA, , line
LZ253, BB, , line
C130, CC, outline
STG25, DD, outline
PP140, EE,outline
MG250, FF, line
TR560,FFoutline
];

I know the mapping load require max 2 field.....

thanks

Regards,

--

SlashSmile

Anonymous
Not applicable
Author

Correct, you cannot do it in one map, so it will be two:


ItemFamilyMap:
mappind load distinct
item as A,
family as b
resident master;

ItemDivisionMap:
mappind load distinct
item as A,
Division as b
resident master;
...

join (item) load
item,
applymap('ItemFamilyMap', item) as family,
applymap('ItemDivisionMap', item) as Division
resident item;

I don't know what exactly you want to achieve. Maybe consider using left join:

item:
Load * Inline [

item,
AZ002
BZcode
LZ253
];

LEFT JOIN (item) Load * Inline [

item , family, Division
AZ002 , AA , line
BZcode, AA, , line
LZ253, BB, , line
C130, CC, outline
STG25, DD, outline
PP140, EE,outline
MG250, FF, line
TR560,FFoutline
];

You'll get the same result. (As a rule, I use mapping if need to apply the same map in more than one place in the script.)