Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Stacked Bar Chart

Hi I have created a bar chart with two dimensions- date and cities- and one expression (sales of products).And I have two listboxes- products and cities.

Now the problem is when nothing is selected, the bar chart is stacked with all cities the values are right but I only want it to be stacked if I select one of the values from the 'Cities' listbox.

e.g. when i select only 'product' and not 'cities' from the listboxes the bar chart should not be stacked. It should display in only one colour.

5 Replies
Gysbert_Wassenaar

In QV11 you can use conditional display expressions to achieve this. For your product dimension you can use =alt(SubStringCount(GetCurrentSelections(),'Cities'),0) so the product dimension is disabled unless one or more cities are selected. See attached example.


talk is cheap, supply exceeds demand
Not applicable
Author

Product is not my dimension. My dimensions are 'weekdisplay' and 'cities'.ie. on X-axis it is 'weekdisplay' and on Y-axis it is sum(sales). This is stacked by cities. I have a listbox with 'Products' in it. Can u suggest something for this situation..

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     May be yes, but Gysbert has given you an Idea how you can do. Try the same logic with your data.

     Community is here to guide you, not to work for you right..

     Give a try and let us know if still it doesnt solve what you want.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi,

I do not want product as a dimension as i do not want to stack the bar chart by products. Hence I cannot apply

Gysbert's suggestion. It would be great if u could suggest something else..

Also i used "=alt(SubStringCount(GetCurrentSelections(),'Product'),0)" for my 'Cities' dimension, however this doesn't stack the bar chart by Cities.

Not applicable
Author

Doesn't matter now.. I found the solution.. Thanks anyways..