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

how to calculate last 6 months and next 6 months sales based on my selection?

Hi,

I have simple requirement if i select any month i want display last 6 month sales.

Ex:if i select march i want dislpay last 6 month sales like  oct,nov,dec,jan,feb and mar.sales i want show. how to write the set expression.

same way if i select any month i want display next 6 month sales.

Ex: If i select June than display june,july ----up to Nov.

Thanks

chaitu

3 Replies
sunny_talwar

May be this

Last 6 months

Sum({<Date = {"$(='>=' & Date(MonthStart(Max(Date), -6), 'DateFieldFormatHere') & '<=' & Date(Max(Date), 'DateFieldFormatHere'))"}, Month, Year, MonthYear>}Sales)


Next 6 months

Sum({<Date = {"$(='>=' & Date(Max(Date), 'DateFieldFormatHere') & '<=' & Date(MonthStart(Max(Date), 7) - 1, 'DateFieldFormatHere'))"}, Month, Year, MonthYear>}Sales)

Anonymous
Not applicable

Hi

Try this 

=Sum({<Date={">=$(=MonthStart(Max(Date),-5))<=$(=MonthEnd(Max(Date),+6))"}>} Sales )Capture5.PNG

Anonymous
Not applicable

Hi,

Please see attached QVW. !