Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
GeromA
Contributor II
Contributor II

Create new category dimension based on field values

Hi all,

 

I'd like to create a dimension in QS to help me categorizing my customers into clusters. Unfortunately, I keep getting the 'invalid dimension' error.

I have a table like this:

CustomerConsumption
Customer A10000
Customer B420000
Customer C900000
Customer D65000
Customer E135000
Customer F152000
Customer G7000
Customer H

3530

 

The clustering formula should do the following:

=if([Consumption]<12001,'0 - 12.000',

if([Consumption]<75001,'12.001 - 75.000',

if([Consumption]<180001,'75.001 - 180.000','180.001 - 1.500.000')))

In addition, there are two limiting criteria that are needed to identify whether the consumption is to be counted.

The final result should look like this:

ClusterCustomerConsumption
0 - 12.000Customer A10000
180.001 - 1.500.000Customer B420000
180.001 - 1.500.000Customer C900000
12.001 - 75.000Customer D65000
75.001 - 180.000Customer E135000
75.001 - 180.000Customer F152000
0 - 12.000Customer G7000
0 - 12.000Customer H3530

 

Many thanks for your solutions.

Best,

GeromA

Labels (3)
1 Solution

Accepted Solutions
agigliotti
MVP
MVP

Hi @GeromA ,

You should add a calculated dimension as below:

aggr( if( sum(Consumption)<12001, '0 - 12.000',
if( sum(Consumption)<75001, '12.001 - 75.000',
if( sum(Consumption)<180001, '75.001 - 180.000', '180.001 - 1.500.000' ))), Customer )

I hope it can helps.
Best Regards

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it

View solution in original post

2 Replies
agigliotti
MVP
MVP

Hi @GeromA ,

You should add a calculated dimension as below:

aggr( if( sum(Consumption)<12001, '0 - 12.000',
if( sum(Consumption)<75001, '12.001 - 75.000',
if( sum(Consumption)<180001, '75.001 - 180.000', '180.001 - 1.500.000' ))), Customer )

I hope it can helps.
Best Regards

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
GeromA
Contributor II
Contributor II
Author

Hi @agigliotti ,

 

thanks, this finally did the trick.

 

Best,

GeromA