Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Action-Packed Learning Awaits! QlikWorld 2023. April 17 - 20 in Las Vegas: REGISTER 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)