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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help With RangeSum

I am using a RangeSum to calculate the accumalative count of model key in an expression over Months as dimension

RangeSum(Above(Count({$<outage_type={0}>} distinct model_key), 0, RowNo()))

This expression shows me accumulative count of the model key over months  in line chart . but when i am selecting the values of only a month in the chart it shows count of model key only associated with the given selection. and does not show me the same count as it was showing in the trend chart by selecting only year

in this example 17 was the no of model key for May as accumulative no but shows only 13 on double clicking the value in chart for month of May . I want same value even when selecting the month

Please refer the attached

10 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

See this document: Calculating rolling n-period totals, averages or other aggregations


talk is cheap, supply exceeds demand
sunny_talwar

Try this:

=If(Count({$<outage_type={0}>} distinct model_key) > 0, RangeSum(Above(Count({$<outage_type={0}, Month = >} distinct model_key), 0, RowNo()))


Add Month and all other calendar object where you can make a potential selection in your RangeSum expression Above (Month =, MonthYear = , Year = , Week = and so on)


HTH


Best,

Sunny

Not applicable
Author

I added Year=, Month=,and Day= in expression , still when i click the value on chart it showing same 13

But with the above suggestion , this is showing fine when i am selecting the Month from calendar

sunny_talwar

What is your dimension on the chart? Did you add that to the expression also?

Not applicable
Author

Thanks it worked after adding the dimesion

sunny_talwar

Awesome

I am glad it worked.

Best,

Sunny

Not applicable
Author

Thanks .. but one more help

i want to start the count for june from 17 onwards but if use the above expression it starts 1st june count only

For example in my current example ,  Till may 31st the accumulative count of model key is 17, but when i select June then it should also consider 17 and start from there onwards

sunny_talwar

‌According to my understanding the expression should handle the June selection, but if it is not able to handle it then I would have to take a look at it. Would you be able to share a sample?

Not applicable
Author

No June Selection is not handling the expression its giving the no of outage type 0 model key added from 1st June

Any suggesstion