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

Stacked Bar Chart - accumulating values reset each year

I am trying to get a stacked bar chart (2 dimensions, 1 measure) to accumulate a count of IDs (unique ID, measure), stacked by their status (dimension) and plotted on the x-axis by a drill down dimension that goes from Location - CreationWeekNo- Sublocation.

My data looks like this:

Location ID Status CreationDate CreationWeekNo CreationYear Sublocation
AA 123 Completed 12/1/2019 2019/49 2019 A320
AA 125 Draft 12/8/2019 2019/50 2019 A322
AA 126 Draft 12/8/2019 2019/50 2019 A321
AA 129 Completed 1/1/2020 2020/01 2020 A320
AA 131 Submitted 1/2/2020 2020/01 2020 A321
AA 132 Rejected 1/7/2020 2020/02 2020 A320
BB 127 Completed 12/1/2019 2019/49 2019 B321
BB 128 Draft 12/8/2019 2019/50 2019 B321
BB 130 Draft 1/1/2020 2020/01 2020 B322
BB 133 Submitted 1/2/2020 2020/01 2020 B322
BB 134 Rejected 1/7/2020 2020/02 2020 B322
BB 135 Draft 1/3/2020 2020/01 2020 B315
BB 136 Completed 1/7/2020 2020/02 2020 B322

 

My measure is just Count(ID). My bars are stacked by the Status, and my drill-down is LocationCreationWeekNoSublocation. With nothing drilled down yet, I would like it to show:

image.png

Once filtering on Location (AA), I'd like it to show an accumulated value that resets on the beginning of each year:

image.png

Once filtering on CreationWeekNo (2020/01), I'd like it to show just the stacked bars based on which Sublocation:

image.png

Is this even possible in Qlik Sense? I can get my drill-down dimension to work easily and I can get an accumulation to work with my measure, but it doesn't reset over year, and it breaks as soon as I add in my Status dimension to the stack:

RangeSum(Above(Count({<[CreationDate]>}[ID]), 0, RowNo()))

Could someone help me out with my measure? Thanks in advance!

Labels (3)
5 Replies
martinpohl
Partner - Master
Partner - Master

Den
Contributor II
Contributor II
Author

I guess I should have said that I'm not sure how to construct a measure to support the accumulation and stack (not that I thought my measure should work :)). Could someone help me construct a measure that works with how I'm trying to get this to work? Thanks in advance!

Steven_Haught
Creator III
Creator III

I may be miss understanding the request, but if you are just trying to represent this in a stacked graph I got it to work in the following manner:

Steven_Haught_0-1596661494393.png

Create the drill down, Location>CreationWeekNo>Sublocation. Place this as the first dimension in a Bar Chart. Place Status as Second Dimension. Count(ID) as Measure. Appearance switch to Stacked. Value label segment only. This replicated each of the desired bar charts in your above comment. 

 

Den
Contributor II
Contributor II
Author

It would've been more apparent if I gave a larger sample data set. The issue I'm having is showing an accumulation/running total of values over year once you drill down past the Location to the WeekNumber.

Steven_Haught
Creator III
Creator III

Can you show an example of the desired accumulation of total?