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: 
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
MVP
MVP

May be use a calculated dimension for this

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

View solution in original post

sunny_talwar
MVP
MVP

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
MVP
MVP

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
MVP
MVP

Try this

Dimension

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

Expression

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

to get this

image.png