Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Rolling 12Months for Sales in Bar Chart

Hello Team,

I am trying to show only last 12 months Total_Expense measure value in bar chart... X-Axis = YYYYMM & Y-Axis= Sum of Total Expense.

I am using Sum(TOTAL_EXPENSE) expression in measure value..


Format is YYYYMM, which data used to.

Can any one help me find out expression which i can use for last 12 rolling months in the bar chart..

Untitled.png

27 Replies
YoussefBelloum
Champion
Champion

here it is

PFA

YoussefBelloum
Champion
Champion

I was just forgetting to change the date format of your field inside the set analysis...

Anonymous
Not applicable
Author

can you send me again QVW with date format updated...

YoussefBelloum
Champion
Champion

It was already updated on the above QVW..I just added a comment to tell why my previous answers didn't work for you

Anonymous
Not applicable
Author

now shall i use

Sum(  {<CLAIM_YEARMONTH={">=$(=AddMonths(Max(Date(Date#(CLAIM_YEARMONTH,'YYYYMM'),'YYYYMM')),-12))<=$(=Max(Date(Date#(CLAIM_YEARMONTH,'YYYYMM'),'YYYYMM')))"}>}  TOTAL_EXPENSE)


in the Total_Expense(Measure) Expression?

YoussefBelloum
Champion
Champion

No, this one is not correct becausse it is not complete..

If you already opened the QVW I send above and the output is fine for you, just use this:

=Sum(  {<CLAIM_YEARMONTH={">=$(=Date(AddMonths(Max(CLAIM_YEARMONTH),-12),'YYYYMM'))<=$(=Max(CLAIM_YEARMONTH))"}>}  TOTAL_EXPENSE)

PS: don't forget to take a look at the script to see how I altered the loading of the CLAIM_YEARMONTH field, you will have to do the same in your script.

hope it is clear

sasiparupudi1
Master III
Master III

Sum({<CLAIM_YEARMONTH={">=$(=Date(Addmonths(Date#(MAX(CLAIM_YEARMONTH),'YYYYMM'),-12),'YYYYMM'))<=$(=Max(CLAIM_YEARMONTH))"}>}TOTAL_EXPENSES)

Anonymous
Not applicable
Author

Thanks Youssef, it works now... I changed the script while loading with date() format... Then expression works for 12months rolling.

Thankyou once again...