How can I create bins for a numerical variable in Qlikview?

qlikview

#1

Hi,

I am creating customer portfolio dashboard in Qlikview and want to have a chart to show the distribution of Customer Age across various buckets like 0-18, 18-25,25-30,30-35,35-40,40-45,45-50,>=50. Please help me to create bins for variable Age.

Thanks,
Satish


#2

@Satish,

You can perform it in two ways:-

  1. Use Calculated dimension to create bins for variables using conditional statements

  2. Create a new variable in edit script based on existing one.

LOAD Region, 
     Zone, 
     Branch, 
     Month, 
     Sales, 
     NOP, 
     Agents,
     if (NOP <20,'0-20',if(NOP>=20 and NOP<35,'20-35','>=35')) as NOP_bin
FROM
Data.xlsx
(ooxml, embedded labels, table is Sheet1);

In above code, you can see that NOP_bin variable is generated based on existing variable NOP using conditional statement if.

Hope this helps!

Regards,
Sunil