Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Highlighted
christopherpoon
New Contributor

Regrouping Dimension values using ApplyMap

Hi Qlikview enthusiasts,

Just a quick question on how to regroup dimension values in a field to new values, using the ApplyMap() function and saved it as a new variable. I have re-loaded the script and unfortunately the variable does not show what I want:

 

1.PNG

 

I want the following Tiers on the left to be regrouped into the ones on the right, done using the ApplyMap() function. In QV, currently my newly created dimension does not function as I want it to:

new created dim.PNG

 

I know that I can do it by nesting multiple IF() statements in the load script but I want to avoid that. Please help, thanks in advance!

Labels (3)
3 Replies
albert_guito
Contributor II

Re: Regrouping Dimension values using ApplyMap

Hi,

At the beginig you can map your groups and insert them with ApplyMap function as:

Map_Group:
Mapping Load * Inline [Tier ,Group
Less than $5K	,Less than $200K
$5KM -< $10K	,Less than $200K
$10K -< $30K	,Less than $200K
$30K -< $200K	,Less than $200K
$200K -< $500K	,$200K -< $500K
$500K		,$200K -< $500K
$500K -< $800K	,$500K -< $1M
$800K -< $1M	,$500K -< $1M
$1M -< $3M	,$1M -< $3M
$3M -< $5M	,$3M -< $5M
$5M -< $8M	,$5M -< $6M
$8M -< $278M	,>$8M
$278M or above	,>$8M
];

Data: Load *, ApplyMap('Map_Group',Tier,'N/A') as Group From ...;

This is running right for you?

 

Ag+

Ag+
christopherpoon
New Contributor

Re: Regrouping Dimension values using ApplyMap

Hey,

Does this 

Data: Load *, ApplyMap('Map_Group',Tier,'N/A') as Group From ...; 

represent the code that I load my table with? and then place the ApplyMap code before that part of the script? 

Re: Regrouping Dimension values using ApplyMap

If data tables has group field, yes the condition will satisfy..
Life is so rich, and we need to respect to the life !!!