Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
semgem12
Contributor III
Contributor III

Dimension colours in stacked bar charts Qlik Sense

Hello

I have a bar chart that measures sales across a number of financial periods. For each period I want the bar to be broken down by customer category (i.e. stacked bar chart). So the bar chart has two dimensions, Period and Category. On the sheet, the period is a filter. The user can select a period and other objects on the sheet reflect various values for that period. But within the bar chart I want all periods to be shown and so I have the measure expression set as

sum({$<Period=>}SalesValue)

When no period is selected each bar is shown as a stacked bar chart reflecting the various categories,

Pic1.png

However, when a period is selected, only the selected period shows the categories,Pic1.png

Is it possible to make all periods show the categories when a period is selected?

Periods are 4 digits, first 2 are the year, last 2 represent the period in the year. E.g. 1710 means period 10 of year 17.

Categories are text, e.g. 'Shops'. There are 6 categories.

Thanks, appreciate any help that anyone can give.

1 Solution

Accepted Solutions
sunny_talwar

Ignore selection for dim field

If(Only({<Period>} dim) = 'Value1', Green(), Red())

View solution in original post

17 Replies
ogster1974
Partner - Master II
Partner - Master II

Hi Semir

Not sure what you are trying to achieve with the request.

If the user selects a period why is it an issue that only the users selection is coloured so they focus on their selection?

Regards

Andy

OmarBenSalem

Suppose you have rolling 12 months for example; and when u select a month; you want to show it and its previous 11 months.. but when u color with dimension; and select any month;; you'll have all the previous shown month scolored in grey..

So, we NEED to figure out a way to keep all the months colored and break the association

Do u see the point?

OmarBenSalem

stalwar1‌, have any idea on how to do this?

ogster1974
Partner - Master II
Partner - Master II

So is the issue down to how the setting of colour is being applied to the chart using colour by Expression rather than using the colour by dimension and measure features added in master items?

Ive not come across the issue myself but perhaps tackling the adding of colour in a different way will resolve this.

Regards

Andy

semgem12
Contributor III
Contributor III
Author

Omar is correct in that I want to be able to see how the selected period compares with other periods.

ogster1974
Partner - Master II
Partner - Master II

sunny_talwar

Are you using an expression for colors in the chart? If you are, then you might need to ignore selection in your color expression also... For example if the expression is like this

Color

change it to this

Only({1} Color)

or

Only({<Period>} Color)

Basically ignore selection in Period for your color expression also...

OmarBenSalem

But I want to have different colors;

sthing like; if(dim='Value1',Green(),red())

how can I do in this case?

sunny_talwar

Ignore selection for dim field

If(Only({<Period>} dim) = 'Value1', Green(), Red())