Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

New Contributor

Help: AVG on aggregate

Hi Expert,

May i know what should i write in order to get average of ACTUAL_MFG_TIME, when i change "Sum" to "Avg" and the figure go wrong. I have no idea what is going on.

=Sum(Aggr(if(($(e_Actwip_Day)>=$(vToggle)),Sum({<REPORT_DATE = {">=$(=Date(Today()-30))<=$(=Date(Today()-1))"},CAL_GROUP={'D'}>}ACTUAL_MFG_TIME),0), Date_DDMMM,PC_IE_REPORT_GRP))

Thanks for the help in advance.


4 Replies

Re: Help: AVG on aggregate

Do you want a sum of averages or an average of sums? In other words should the inner sum be replaced with avg or the outer sum?

talk is cheap, supply exceeds demand

Re: Help: AVG on aggregate

What exactly are you trying to do? Can you provide some more context?

New Contributor

Re: Help: AVG on aggregate

Hi Guys,

In short, i am looking for

1. an average of actual_mfg_time

2. WIthin condition of

- Last 30 days

- Calg_group='D'

- $(e_Actwip_Day)>=$(vToggle)

3. Group by

- Date_DDMMM


I am not sure how to write in term of average. Sum is working fine for me.


Re: Help: AVG on aggregate

So do you have Date_DDMMM and PC_IE_REPORT_GRP as dimension or do you have more dimensions then these? If these are the only two dimensions in your chart then I would just use Avg() with all your above conditions.

Community Browser