Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
jdmarlin
Contributor III
Contributor III

ColorMix and Possible selections

Hello

Situation:

I have a bar chart that switches views between Region and Product and is drawing the chart as:

Sum({<Period=, Region=, Product=>} Sales)


Then I use the ColorMix to draw selections as green and unselected as grey:

If(Period=Period, ColorMix, Grey)


Problem:

The problem occurs when I'm switching between Region and Product. If I select Region A as an example, the bar chart will color the selection properly. But when I switch to the Product view, it's showing me all Products that are associated to Region A instead of Products sold within Region A (Sorry if that's a bit confusing).


In other words... the amount of green should stay the same in both views.


I've tried to use:

Sum({<Period=, Region=P(Region), Product=P(Product)>} Sales) in the ColorMix, but that didn't work, so I'm a bit stumped at solving this.


I've attached a couples pictures of my problem.


And some sample data if you'd like to have a go at it:

RegionProductAmount
AFruits1
AVegetables2
AMeat3
BFruits4
BVegetables5
CMeat6
CVegetables7

Thx!

2 Replies
petter
Partner - Champion III
Partner - Champion III

How do you switch "views"? Is it period that is your dimension?

jdmarlin
Contributor III
Contributor III
Author

I have Period as my first dimension and then Region, Product, or Store as my second dimension.

I have a variable vCycle that I use it as a condition on my dimensions to turn them on/off.


vCycle = 1 is Region

vCycle = 2 is Product

vCycle = 3 is Store

So when I click a button titled Region, it performs an action to change vCycle to 1 and will show me sales by Region.