Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
guya
Contributor II
Contributor II

Dimension in Bar Chart

Hi,

I'm trying to reach the following objective:

Table 1

Dateregioncount
01/11/2018region1100
01/11/2018region220
01/11/2018region330
01/11/2018region415
01/11/2018region520
01/12/2018region140
01/12/2018region250
01/12/2018region320
01/12/2018region430
01/12/2018region560

table2 is a calendar table.

create bar chart for specific month but only 4 regions in the dimension, which are region1, region2, region3&4 and region5. So only one bar for the combined region 3 and 4.

Thanks for the help! 

2 Solutions

Accepted Solutions
sunny_talwar

May be use a calculated dimension for this

If(match(region, 'region13, 'region4'), 'region3&4', region)

View solution in original post

sunny_talwar

Try this

Dimension

=If(Match(Region, 'region3', 'region4'), 'region3&4', Region)

Expression

Sum({<Type = {'High'}>}count)

to get this

image.png

View solution in original post

4 Replies
sunny_talwar

May be use a calculated dimension for this

If(match(region, 'region13, 'region4'), 'region3&4', region)
dplr-rn
Partner - Master III
Partner - Master III

Like sunny suggested. Doing this in the backend script would be the most efficient (performance) way to go forward; especially if data is big.

But if data size if not a concern; for flexibility front end maybe better. Use valuelist option

https://community.qlik.com/blogs/qlikviewdesignblog/2013/07/01/valuelist-for-those-tricky-situations

 

 

guya
Contributor II
Contributor II
Author

Many thx for your prompt reply. Actually I must give more details.

I have region's table like this:

RegionIDRegionType
1region1High
2region2High
3region3High
4region4High
5region5High
6region6Low
7region7Low
8region8Low
9region9Low

 

and transactions table:

DateRegionIDcount
01/11/20181100
01/11/2018220
01/11/2018330
01/11/2018415
01/11/2018520
01/12/2018140
01/12/2018250
01/12/2018320
01/12/2018430
01/12/2018560

 

And the bar chart must only take into account the region where type= 'High', and the dimension must show only 4 high regions where 1 of them is a combination of 2. So dimension should be :

region1 - region2 - region3&4 - region5

Both solutions in the chart or backend script are welcome.

Thx,

sunny_talwar

Try this

Dimension

=If(Match(Region, 'region3', 'region4'), 'region3&4', Region)

Expression

Sum({<Type = {'High'}>}count)

to get this

image.png