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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

AVG on formula

I have a formula field  that looks like this “sum(a)+sum(b)/sum(c)”

I need to do avg on this formula without changing the field formula.

Tried avg(formula) it didn’t work. Any ideas ??

5 Replies
ariel_klien
Specialist
Specialist

Hi,

Try to do this on the script level like:

Load ...

        sum(a)+sum(b)/sum(c) as formula

from....

and in the expression put avg(formula)

BR

Ariel

whiteline
Master II
Master II

Hi.

Avg() means that you have a set of results of your formula. Suppose that you want to get the average of  a set that is provided by dimension Dim. Then you could write an expression:

=avg(aggr(fourmula, Dim))

Jason_Michaelides
Partner - Master II
Partner - Master II

Have you tried Avg((a+b)/c)?

rajeshvaswani77
Specialist III
Specialist III

Have you missed out the brackets in your formula?

(sum(a)+sum(b))/sum(c)


thanks,

Rajesh Vaswani

lironbaram
Partner - Master III
Partner - Master III

hi as far as i know

if you want to do an average on sum function you need to define the dimension on which you calculate the average

let say you want to do average for customer then you'll expression will look

avg(aggr(Formula,Customer))