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

Sum(Value) for last 12 months having only YearMonth

Hello,

What is the best formula to add the values of the last 12 months having only Year and Month in the yyyymm format?

Thanks for helping

 

Labels (3)
1 Solution

Accepted Solutions
steeefan
Luminary
Luminary

Try this: Sum({<Calendar.YearMonth = {">=$(=Date(MonthStart(AddMonths(Today(), -11)), 'YYYYMM'))<=$(=Date(MonthEnd(Today()), 'YYYYMM'))"}>} Value)

You might have to adjust the field name where your YearMonth values are stored. Here I'm using Calendar.YearMonth.

View solution in original post

1 Reply
steeefan
Luminary
Luminary

Try this: Sum({<Calendar.YearMonth = {">=$(=Date(MonthStart(AddMonths(Today(), -11)), 'YYYYMM'))<=$(=Date(MonthEnd(Today()), 'YYYYMM'))"}>} Value)

You might have to adjust the field name where your YearMonth values are stored. Here I'm using Calendar.YearMonth.