Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Bar chart

I'm fairly new to Qlikview so please bear with me...

In a very simple world, let's say I have a bar chart to show total sales and total expenses, and I have a list box to choose a region (or not). If a region is selected, then the bar chart will show just total sales and total expenses for that region and if nothing is selected then I'd like the bar chart to show total sales and total expenses for the whole company. I don't really want to see all the regions in the chart. So in a way, I always want to see only two bars, one for total sales and one for total expenses. They could represent either the company or just one region.

2 Solutions

Accepted Solutions
Highlighted
Partner
Partner

Create the chart using 2 dimensions, one for company and one for region. 

Use a enable condition on the region dimension, IF(ISNULL(GetFieldSelections(region)),0,1). That will make the dimension only appear when a selection is made.

View solution in original post

Highlighted
Creator III
Creator III

Ok so I thought about this a little more and I think there is probably a simpler solution.

Why not just remove the dimensions all together and have the expressions do there calculations across the whole population (assuming you have 1 company in the data)? If you do this, then with no selections made you will have the totals you expect for the company and when you make a selection on a particular region, those calculations will change to be only for that region.

View solution in original post

7 Replies
Highlighted
Partner
Partner

Create the chart using 2 dimensions, one for company and one for region. 

Use a enable condition on the region dimension, IF(ISNULL(GetFieldSelections(region)),0,1). That will make the dimension only appear when a selection is made.

View solution in original post

Contributor III
Contributor III

Thank you, this is indeed the way to go.

Highlighted
Contributor III
Contributor III

I have another question for Cbusheybd as what I'm seeing is probably related to the solution I implemented.

Now that I have done as you suggested, I see some quirky behavior. My chart is a bar chart (Subtype Grouped in Style). When I pick no region in filter, I see the company numbers correctly as Grouped, but when I pick a region, the chart becomes Stacked. Any idea? Thanks in advance.

Highlighted
Creator III
Creator III

The chart subtype shouldn't be impacted by an enable condition on the dimension. 

Could you attach some screenshots of the chart and its properties so I can try to replicate?

Highlighted
Contributor III
Contributor III

Hi, I attached a word doc with screenshots. Let me know what you think. Or need to see anything else. Thanks

Highlighted
Creator III
Creator III

Ok so I thought about this a little more and I think there is probably a simpler solution.

Why not just remove the dimensions all together and have the expressions do there calculations across the whole population (assuming you have 1 company in the data)? If you do this, then with no selections made you will have the totals you expect for the company and when you make a selection on a particular region, those calculations will change to be only for that region.

View solution in original post

Highlighted
Contributor III
Contributor III

Yes! I was totally missing the forest for the trees. I had 'region' as a dimension, and then couldn't figure out how not to see all the data points for region dimension, so came here to post the original question. Your simple solution works just fine. Thanks again.