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

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
Creator II
Creator II

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+
Anonymous
Not applicable
Author

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? 

Anil_Babu_Samineni

If data tables has group field, yes the condition will satisfy..
Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful