Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
danielreber
Contributor II
Contributor II

Monthly Average With Detail Data

I have data at the day level but I would like to create an expression that calculates the monthly average for the last six months. I am currently using

=num(avg({< _M={13,12,11,10,9,8} >}total TransactionAMT*-1),'$#,##0')

with "_M" being the month number field and 8-13 being the last six months.  However, the calculation is averaging the data at the day level.  How do I calculate a monthly average for the last six months?

Thanks

Dan

2 Replies
danielreber
Contributor II
Contributor II
Author

 I believe I figured it out using 

=num(avg({< _M={13,12,11,10,9,8} >} aggr(sum(TransactionAMT*-1),_M)),'$#,##0')

Is this correct?

sunny_talwar


@danielreber wrote:

 I believe I figured it out using 

=num(avg({< _M={13,12,11,10,9,8} >} aggr(sum(TransactionAMT*-1),_M)),'$#,##0')

Is this correct?


Looks correct to me