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

Aggr Last 12 Months

Hi, need some help...

I need the aggr sales expression for the last 12 month...

Can some help me?

Thanks in advance,

FLC

3 Replies
anbu1984
Master III
Master III

Try like this

Aggr({<Date_dim={"$(= '>=' & date(Today()-365) & '<=' & date(Today()))"}>}Sales,Dim)

Not applicable
Author

I formulate the question badly, I found the way in the time dimension table:

Aggr(sum(sales), MATid)

Thanks any way...

hic
Former Employee
Former Employee

I would define a relative Month already in the script:

   12*(Year(Today())-Year(Date)) + Month(Today()) - Month(Date) as MonthsAgo,

then your expression would be

   Sum({$<MonthsAgo={">=0<12"}>} Sales)

See more on:

* http://community.qlik.com/blogs/qlikviewdesignblog/2013/06/10/relative-calendar-fields

* http://community.qlik.com/blogs/qlikviewdesignblog/2013/03/11/when-should-the-aggr-function-not-be-u...

HIC