Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
aniruddhyadutta
Creator
Creator

Cumulative sum expression is working erracticly

Hi all,

I am facing some issues while calculating the cumulative sum

when I am using this expression my chart is showing correct data

RangeSum(Above(Sum({$< Hour_15={'$(v2)','$(v3)','$(v4)'}>} ALERT_Count),0,RowNo()))

cum.PNG

but this same expression if I use with an if else condtion is not behaviung correctly

If (SELECTOR = 'CUM',RangeSum(above(sum({$< Hour_15={'$(v2)','$(v3)','$(v4)'}>} ALERT_Count),0,RowNo())), sum({<Hour_15= {'$(v2)','$(v3)','$(v4)'}>}ALERT_Count))

wrong cum.PNG

here you can see the cumulative has been done from 11:00 and 11:15.

I am using the if -else to use the expression in a toggle expression.

3 Replies
marcus_sommer

Try it with:

RangeSum(Above(Sum({$< Hour_15={'$(v2)','$(v3)','$(v4)'}, SELECTOR = {'CUM'}>} ALERT_Count),0,RowNo()))

- Marcus

aniruddhyadutta
Creator
Creator
Author

Hi Marcus,

it worked for 'CUM'

but this is I believe has become hard coded for only "Cum'.Is there any way to make this expression dynamic i.e if we select 'Non-Cum' as a selector value to show in the same expression?

Thanks,

Aniruddhya

marcus_sommer

Try it with:

RangeSum(Above(Sum({$< Hour_15={'$(v2)','$(v3)','$(v4)'}, SELECTOR = p(SELECTOR)}>} ALERT_Count),0,RowNo()))

- Marcus