Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

paulyeo11
Valued Contributor II

How to recode 15 brand to 4 brand using Map thru Excel file ?

Hi All

I have below script , it does not give me any error :-

MapBrand:

Mapping LOAD

  [Brand_],

  [SubBrand_]

FROM  mapsubbrand.xlsx (ooxml,embedded labels, table is [Sheet4]);

My excel file have below brand :-

Brand_ SubBrand_

HAKKO HAKKO

BECKHOFF BECKHOFF

MITSUBISHI MITSUBISHI

MITSUBISH MITSUBISHI

GE FANUC GE FANUC

GE GE FANUC

My script when load raw data :-

Applymap('MapBrand',(subfield(@282:298,' ',1)),@282:298) as [BRAND_],

@282:298T as [bRAND_], // Pls note this field have more then 10 brand. I need to display only 4 brand.

Now my issue is it display all the brand , I need you recode this filed BRAND_ only display 4 core brand , meaning i need it only display Beckhoff , Hakko , GE , Mitsubishi and Other ,Now it display all brand is wrong.

Hope some one can advise me.

Paul

1 Solution

Accepted Solutions
Employee
Employee

Re: How to recode 15 brand to 4 brand using Map thru Excel file ?

Try

Applymap('MapBrand',(subfield(@282:298,' ',1)),'Others') as [BRAND_],

5 Replies
paulyeo11
Valued Contributor II

Re: How to recode 15 brand to 4 brand using Map thru Excel file ?

Enclosed My QV doc

Employee
Employee

Re: How to recode 15 brand to 4 brand using Map thru Excel file ?

Try

Applymap('MapBrand',(subfield(@282:298,' ',1)),'Others') as [BRAND_],

MVP
MVP

Re: How to recode 15 brand to 4 brand using Map thru Excel file ?

//Applymap('MapBrand',(subfield(@282:298,' ',1)),@282:298) as [BRAND_],

Applymap('MapBrand',@282:298,'Other') as [BRAND_],

Re: How to recode 15 brand to 4 brand using Map thru Excel file ?

Hi,

not an answer to your question, but if you replace

@282:298


with


[@282:298]


then the editor will not show syntax error marks.



hope this helps


regards


Marco

paulyeo11
Valued Contributor II

Re: How to recode 15 brand to 4 brand using Map thru Excel file ?

Hi All

Thank you very much it work fine.

Paul