Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
triekong
Creator
Creator

Show last 12 months data based on filter selected & Year

i have data from Dec2016, to Dec2018 in my report and want to be able to view the last 12months of data from when a date is selected.

i have implemented this solution in my report. but i have an issue with the years on the report.

SUM({$<MONTH_NUMERIC = {">=$(=vMaxMonth-11)<=$(=vMaxMonth)"},Month>} if([Question Category]='Overall Customer Satisfaction',[Question Score],0))

when i select the Month Year of "December 2017" for example, i want the data to go back 12months from then.

Using the expression above, expected result is : Dec2017,Nov2017,Oct2017,Sept2017,Aug2017,Jul2017,Jun2017,May2017,Apr2017,Mar2017,Feb2017,Jan2017.

using the expression above, it seems to be including both "December2016" and "December2017", and "January2017" and "January2018" on the chart, irrespective of what year it they are in. so the data now goes from Dec2016 to Jan2018.

how can i handle this?

thanks!

1 Reply
sunny_talwar

Try this expression

Sum({$<MonthYear = {">=$(=Date(AddMonths(Max(MonthYear), -11), 'MMM-YYYY'))<=$(=Date(Max(MonthYear), 'MMM-YYYY'))"}, Month, [Question Category]= {'Overall Customer Satisfaction'}>} [Question Score])