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

Qlik Sense: Rolling 12 months on stacked bar chart

Hi!

I have a stacked bar chart that shows a percentage distribution of a certain type of data for each Year-month.

Now I need to show only last 13 months. I changed the formula to rolling, but it works in strange ways.

The graph is colored according to the value of a filed defined as master item dimension.

If there is no selection, the graph correctly  shows 13 months with the right allocation:

graph ok.PNG

 

If I select a Year-Month from my filter,  the graph shows like this (right periods, right allocations, but no colors):

graph ko.PNG

 

The bars are colored only if the relative Year-Month is selected:

graph ko 2.PNG

 

I changed the formula to rolling (AnnoMese is my filter and the period shows in the graph. It comes from test_date:

Count( {<AnnoMese=, test_date={">=$(=addMonths(max(test_date),-12)) <=$(=max(test_date)) "}>} test_id) /
Count( total <AnnoMese> {<AnnoMese=, test_date={">=$(=addMonths(max(test_date),-12)) <=$(=max(test_date)) "}>} test_id)

 

Can someone help me?

Thanks.

0 Replies