# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Rules, plus terms and conditions, can be found here.
New Contributor III

## Average Per day of Month

Hello,

I am looking for a way to get an average amount per day of the month over the last 12 months. For example, I would need to sum the amount on 12/1, 1/1, 2/1, etc. and average that number. I would need to do that for every day. Any help on this would be greatly appreciated.

13 Replies
MVP

## Re: Average Per day of Month

May be this

Sum(Aggr(Avg(Value), Date))

MVP

## Re: Average Per day of Month

Sunny, don't you mean:

Avg(Aggr(Sum(Value), Date))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
MVP

## Re: Average Per day of Month

Not sure I am clear if OP wants to do Avg each day and then sum or sum each day and then average.... but you could be right

New Contributor III

## Re: Average Per day of Month

I would want to sum every day (12/1, 1/1, 2/1) and then average

MVP

## Re: Average Per day of Month

Then jontydkpi‌'s response is the right one I guess

Honored Contributor

## Re: Average Per day of Month

Hi Kyle,

try a straight table with calculated dimension

=Day(Date)

and expression

avg(Aggr(Sum(Amount),Date))

Good luck

Andrew

Valued Contributor

## Re: Average Per day of Month

Maybe this

=avg(Aggr(Sum(Amount),YearField,MonthField))

Regards

Pratyush

New Contributor III

## Re: Average Per day of Month

How would I just grab the last 12 months?

MVP

## Re: Average Per day of Month

Are you trying to get rolling 12 months?