Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Bar Chart Based on Condition

Hi,

I am having region and city bar chart. In one region there are many cities. I created a bar chart which showing all the regions and another bar chart for the cities. What I need is if I select any of the region then the bar chart with cities should display that is if no region selected then city bar chart should be hidden.

1 Solution

Accepted Solutions
maxgro
MVP
MVP

in your cities bar chart

layout--> show--> conditional

use the expression

GetSelectedCount(NameOfYourRegionField)>0

the cities bar chart will show only when 1 or more region is selected

another useful function for similar requirement is GetPossibleCount

View solution in original post

5 Replies
maxgro
MVP
MVP

in your cities bar chart

layout--> show--> conditional

use the expression

GetSelectedCount(NameOfYourRegionField)>0

the cities bar chart will show only when 1 or more region is selected

another useful function for similar requirement is GetPossibleCount

mangalsk
Creator III
Creator III

Hello,

PFA

in chart properties

Set following:

Layout->show->conditional=getselectedCount(region)>0

Regards

Not applicable
Author

Hi Massimo,

Thanks for your response. By giving this the city bar chart is hiding but not showing even if I select any of the region.

its_anandrjs

In chart properties -> Layout -> Show -> Conditional =>  =GetFieldSelections(Region) > 0 and thats it.

Hope this helps

Thanks & Regards

MarcoWedel

You are looking for a drill down group consisting of the groups region and city used as the dimension in only one bar chart.

In the dimensions tab of the chart properties you can create this group.

The initial state of this chart would be to display bars per region.

When selecting a region-bar in the chart, the dimension group would drill down to the cities of the selected region.

No need for seperate charts and conditions to hide or display one.

regards

Marco