Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
nezuko_kamado
Creator
Creator

How NOT to draw accumulated line for missing month or NAs?

I draw accumulated barchart and line chart  by

rangesum(above(Sum({$<Year ={'2019'}>} Unit), 0, RowNo()))

rangesum(above(Sum({$<Year ={'2020'}>} Unit), 0, RowNo()))

rangesum(above(Sum({$<Year ={'2021}>} Unit), 0, RowNo()))

rangesum(above(Sum({$<Year ={'2022'}>} Unit), 0, RowNo()))

 I don't have data points for Mar and Apr for 2022, but the flat line is drawn for missing month. However, I only want to add line for the months have data point 

nezuko_kamado_0-1658861245349.png

I manually designated months to show here

if(Sum({<Month={'Jan','Feb'}>} Unit)=0,Null(),rangesum(above(Sum({$<Year ={'2022'}>} Unit), 0, RowNo())))

 

But is there any code that only shows month which is not NA or not missing?

Labels (3)
1 Solution

Accepted Solutions
nezuko_kamado
Creator
Creator
Author

I found that, in Qlik, if else doesn't require 'else' parameter always. 

If(Sum({$<Year ={'2022'}>}Unit) > 0, RangeSum(Above(Sum({$<Year ={'2022'}>} Unit),0,RowNo())))

View solution in original post

1 Reply
nezuko_kamado
Creator
Creator
Author

I found that, in Qlik, if else doesn't require 'else' parameter always. 

If(Sum({$<Year ={'2022'}>}Unit) > 0, RangeSum(Above(Sum({$<Year ={'2022'}>} Unit),0,RowNo())))