Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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;