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

Stacked Waterfall chart with one dimension and multiple expressions

Hello,

I want to create a stacked waterfall chart with one dimension and multiple expressions. 

Basically, I have Planning data and multiple timestamps, where the planning data is reduced. In the end it should show a stacked bar chart with the Actual data (planning data - reductions). Unfortunately, I dont get the offset right. 

Attached a picture of the data and also the responding qvw. Can anyone help me with the Offset?

Thank you very much in advance! Screen Waterfall.png

Labels (1)
2 Solutions

Accepted Solutions
sunny_talwar

It is difficult for me to explain why it works what I have, but it kind of does. New expressions

=If(RowNo() = 1 or RowNo() = (countMaßnahmenrunde)+1, Sum(Verfuegt), -Sum(Verfuegt))

=If(RowNo() = 1 or RowNo() = (countMaßnahmenrunde)+1, Sum(Pipeline), -Sum(Pipeline))

=If(RowNo() = 1 or RowNo() = (countMaßnahmenrunde)+1, Sum(Obligo), -Sum(Obligo))

New offset expression

=If(RowNo() = 1 or RowNo()=(countMaßnahmenrunde)+1, 0,
RangeSum(Above(Sum(Verfuegt) + Sum(Pipeline) + Sum(Obligo), 0, RowNo()))) 

image.png

 

View solution in original post

sunny_talwar

Added a new expression for displaying

Annotation.png

View solution in original post

6 Replies
sunny_talwar

It is difficult for me to explain why it works what I have, but it kind of does. New expressions

=If(RowNo() = 1 or RowNo() = (countMaßnahmenrunde)+1, Sum(Verfuegt), -Sum(Verfuegt))

=If(RowNo() = 1 or RowNo() = (countMaßnahmenrunde)+1, Sum(Pipeline), -Sum(Pipeline))

=If(RowNo() = 1 or RowNo() = (countMaßnahmenrunde)+1, Sum(Obligo), -Sum(Obligo))

New offset expression

=If(RowNo() = 1 or RowNo()=(countMaßnahmenrunde)+1, 0,
RangeSum(Above(Sum(Verfuegt) + Sum(Pipeline) + Sum(Obligo), 0, RowNo()))) 

image.png

 

Apfelbaum
Contributor II
Contributor II
Author

Perfect, thank you so much! 

I think I understand what you did there:  You made the negative numbers in the expression positive. In the offset, you still used the negative numbers. Therefore the offset is correct and they stack normally. 

Genius! 🙂 

 

Edit: Basically, instead of the if-clause one can also say 

fabs(sum(Verfuegt))
fabs(sum(Obligo))
fabs(sum(Pipeline))

and it works. You just want to convert a negative sum to a positive number, which the fabs function does 🙂  

Apfelbaum
Contributor II
Contributor II
Author

@sunny_talwar 

One more question: Do you know, how I can show that the numbers are negative? 

Because right now, the "Values on Data Points" Feature shows a positive number on the bars. Which might be confusing as the numbers originally are negative. 

sunny_talwar

Checking

sunny_talwar

Added a new expression for displaying

Annotation.png

Apfelbaum
Contributor II
Contributor II
Author

That works perfect. Thank you very much! 🙂