Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
JohanLind1979
Contributor III
Contributor III

Stacked Bar Chart Two Dimensions Cumulated Values

Hi, I want to create a Stacked bar chart in Qlik Sense with cumulative values using two dimensions. Is this possible? We had one in QlikView and it looked like the attached image. I tried to use Rangesum(Above([Expression],0,rowno())) but it didn´t work.

10 Replies
rubenmarin

That looks like an issue on the way accumulations are calculated, in this case I would suggest to create data so all combinations on Entry and month has data, this script assigns zero to the non-existant combinations:

Data:
NoConcatenate
LOAD Entry, Data, Dual(Month, NumMonth) as Month, Entry &'_'& Month as KeyLoaded;
LOAD *, Num(Month(Date#(Month, 'MMM'))) as NumMonth Resident Blad1 where Data<>0; // This 'where' is just to simulate the null value on Jul

DROP Table Blad1;

// Generate all possible combinations between Entry and Month
Cartesian:
LOAD FieldValue('Entry', RecNo()) as Entry AutoGenerate FieldValueCount('Entry');
Join LOAD FieldValue('Month', RecNo()) as Month,
	Num(Month(Date#(FieldValue('Month', RecNo()), 'MMM'))) as NumMonth
AutoGenerate FieldValueCount('Month');

// Add to loaded data those that doesn't exists
Concatenate (Data)
LOAD Entry, 0 as Data, Dual(Month, NumMonth) as Month
Resident Cartesian where not exists('KeyLoaded', Entry &'_'& Month);

DROP table Cartesian;
DROP Field KeyLoaded;