Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to reach the following objective:
Table 1
Date | region | count |
01/11/2018 | region1 | 100 |
01/11/2018 | region2 | 20 |
01/11/2018 | region3 | 30 |
01/11/2018 | region4 | 15 |
01/11/2018 | region5 | 20 |
01/12/2018 | region1 | 40 |
01/12/2018 | region2 | 50 |
01/12/2018 | region3 | 20 |
01/12/2018 | region4 | 30 |
01/12/2018 | region5 | 60 |
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!
Try this
Dimension
=If(Match(Region, 'region3', 'region4'), 'region3&4', Region)
Expression
Sum({<Type = {'High'}>}count)
to get this
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
Many thx for your prompt reply. Actually I must give more details.
I have region's table like this:
RegionID | Region | Type |
1 | region1 | High |
2 | region2 | High |
3 | region3 | High |
4 | region4 | High |
5 | region5 | High |
6 | region6 | Low |
7 | region7 | Low |
8 | region8 | Low |
9 | region9 | Low |
and transactions table:
Date | RegionID | count |
01/11/2018 | 1 | 100 |
01/11/2018 | 2 | 20 |
01/11/2018 | 3 | 30 |
01/11/2018 | 4 | 15 |
01/11/2018 | 5 | 20 |
01/12/2018 | 1 | 40 |
01/12/2018 | 2 | 50 |
01/12/2018 | 3 | 20 |
01/12/2018 | 4 | 30 |
01/12/2018 | 5 | 60 |
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,
Try this
Dimension
=If(Match(Region, 'region3', 'region4'), 'region3&4', Region)
Expression
Sum({<Type = {'High'}>}count)
to get this