Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Now Live: Qlik Sense SaaS Simplified Authoring – Analytics Creation for Everyone: READ DETAILS
Showing results for 
Search instead for 
Did you mean: 
Creator III
Creator III

RangeAvg function

Hey guys,

I am trying to use the RangeAvg function to create an alert and should look like something below which one of you guys has already helped me out with. You think it would be easy that I could just replace [Record Count] with

                      (sum([Record Count]) - rangeavg(after(sum([Record Count]),1,6)))  / rangeavg(after(sum([Record Count]),1,6))

aggr(sum({<[Control Description]={"Claim Payment"},
[Fiscal Year Month] = {"2015-12" }>}
[Record Count]),
Country & ': Claim Payment is reported as zero.' & chr(10))

I want to send an alert if the above expression < 0% or over 50%. I tried using if statements

if((sum([Record Count]) - rangeavg(after(sum([Record Count]),1,6)))
rangeavg(after(sum([Record Count]),1,6)) < '0%'


sum([Record Count]) - rangeavg(after(sum([Record Count]),1,6)))
rangeavg(after(sum([Record Count]),1,6)) > '50%'

Any help appreciated.

2 Replies

Hi Bobby (or Dave?)

I think it would be a lot easier to troubleshoot if you posted a sample app with your calculation.

Just by looking at the formulas, I suspect that the problem is caused by using the function After(). This is a Chart function that cannot be used outside of charts (i.e. in an Alert). The term After() pertains to the following row in the chart. Outside of the chart, the function is meaningless.

That's just a wild guess by looking at your rather complex formulas. If you'd like anyone to do any further analysis, please post a sample.


Oleg Troyansky

Upgrade your Qlik skills at the Masters Summit for Qlik - coming soon to Milan, Italy!

Not applicable

You can't use AFTER function out side of the chart object.

Instead of writing the complex UI expressions, calculate the expressions in the script level and  create new table with flag. Based on the flag you can directly trigger the Alert.