Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

How to recode both SOURCE salesman using MAP ?

Hi All

Below script work fine :-

MAP_NAME:
mapping LOAD RAW,
NAME
FROM
[MAP_A.xlsx]
(ooxml, embedded labels, table is MAP_A);

For Each i in 'A','B'

LOAD

COY,

SALESMAN,

'$(i)' as SOURCE,

ApplyMap('MAP_NAME',[SALESMAN],'OTHERS') as [SALESMANE_],

SALES

FROM

COY_$(i).xlsx (ooxml, embedded labels, table is COY_$(i));

NEXT i;

Above script generate below table  :-

MAP_NAME.pngNoe the highlight red color line not able recode SOURCE = B

Hope some one can advise me.

Below is my Map Table for SOURCE A.

map_a.png

3 Replies
Or
MVP
MVP

This looks like it's working correctly? There are no mapping values associated with the latter two values, so they are assigned OTHERS.

paulyeo11
Master
Master
Author

Hi Sir

You are correct , it work fine.,because I don’t know how to create MAP for record SOURCE = B

In my actual application , they are 20 sales man , or 20 brand or 30 segment , I need to recode to top 8 brand or segment , and each SOUCE A and B , have diff list of TOP 8.

Meaning every SOURCE have their individual mapping table , depend on their amount.

Since I am using FOR I approach to load , I am only allow one line of MAPPING script .

If I am Nor using FOR I to load , I use manual load , I can have individual mapping script .

It there any way I can use map with FOR I ?

Paul
paulyeo11
Master
Master
Author

Hi All

https://community.qlik.com/t5/QlikView-Scripting/How-to-create-one-expression-to-replace-multiple-ex...

Above is the sample file i created , hope you can advise me.

Paul