Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Avg

Hi,

In my application i'm trying to take an average from a calculated value (relative number of orders in the week). For this i'm trying to use the following expression:

=avg(aggr(Sum(Order)/Sum(TOTAL Order),Store))

Which will aggregate the percentage of orders in the week by the store and take the average from this values. But it's not working, could somebody help me?

On the attachment i've made and example of what i need (The average of the percentage from each day of the week on each week of the month of both stores). Doing it by hand it shold be showing 63% (fisrt store, monday of the first week) + 55% (Second store, monday, first week) /2 = 59%.

I appreciate the help.

Thanks!

4 Replies
bill_markham
Not applicable

Re: Avg

How about an expression something like :

     sum ( Order ) / sum ( TOTAL Order )

MK_QSL
Not applicable

Re: Avg

=avg(TOTAL aggr(Sum(Order)/Sum(TOTAL Order),Store))

Not applicable

Re: Avg

Could you do an example for me? I tried but it didn't work.

elena888
Not applicable

Re: Avg

Try this:

=(

Sum({<Store={1}>}Order)/Sum({<Store={1}>}TOTAL Order) + Sum({<Store={2}>}Order)/Sum({<Store={2}>}TOTAL Order))/GetPossibleCount(Day

)

KR