Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
arixooo123
Creator III
Creator III

dividing a dimension into some pieces to better show it in a bar chart

  dears!

  I have a column in a table called city, This column has more than 100 distinct values. using city column as a dimension,

  when i create a stacked bar chart, since there are many of them(cities).  I cannot see much of that in the chart and it gets so messy.

  is it possible to break a dimension with 100 possible values into 5 groups of dimensions each has 20 values?

  Thanks for your help in advance.

13 Replies
saumyashah90
Specialist
Specialist

cool then let him answer

arixooo123
Creator III
Creator III
Author

Thanks everyone for your help. I thought there's a way to break down a dimension in Qlickview. but apparently there isn't.

I am adding another column to the table in database. and assign values Group1,Group2,...Group6 to cities. in this way i can separate them.

there is no better way? Right?

terezagr
Partner - Creator III
Partner - Creator III

I think your way would be the best one. Like that, you do not need to hardcode it in the script and if any new groups are going to be added you will add them into your database

You can always hardcoded in your script by using nested if statement or PICK() function will solve it too.

IF nested:

if(mixmatch(City, 'Paris','Barcelona'),'Group1',

     if(mixmatch(City,'Tokio'),'Group 2',

          if(mixmatch(City,'New York'),'Group 3',

                    'Group 4'))) as City_Groups

Pick function:

Pick(Wildmatch((City),'Paris','Barcelona','Tokio','New York'),

                              'Group 1', 'Group 1','Group 2','Group 3')

                                        as City Groups

raviteja475
Contributor
Contributor

actually i got the answer but i need to make the groups having hiearchy to show the city names beside the groupname like 

group1-->newyork,tokyo

group2-->paris,london

group3-->sydney is there any chances can i get like this