Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
RubénHPaz
Contributor III
Contributor III

Sum last n months

Morning... I want to sum last 12 months... I put this expression but don't sum...

 

=Sum({<DocumentoFechaEmision={">=$(=MonthStart(AddMonths(Max(DocumentoFechaEmision),-12)))<=$(=MonthEnd(AddMonths(Max(DocumentoFechaEmision),-1)))"}>}SOLES)

 

DocumentoFechaEmision = The date of the bill, with the month obviously

SOLES = The quantity to sum

 

Please help...

Labels (3)
1 Solution

Accepted Solutions
saminea_ANZ
Creator
Creator

Can you please check, If there is any problem with date format?

=Sum({<DocumentoFechaEmision={">=$(=Date(MonthStart(AddMonths(Max(DocumentoFechaEmision),-12)),'Your Field Format'))<=$(=Date(MonthEnd(AddMonths(Max(DocumentoFechaEmision),-1)),'Your Field Format'))"}>}SOLES)

View solution in original post

1 Reply
saminea_ANZ
Creator
Creator

Can you please check, If there is any problem with date format?

=Sum({<DocumentoFechaEmision={">=$(=Date(MonthStart(AddMonths(Max(DocumentoFechaEmision),-12)),'Your Field Format'))<=$(=Date(MonthEnd(AddMonths(Max(DocumentoFechaEmision),-1)),'Your Field Format'))"}>}SOLES)