6 Replies Latest reply: Aug 12, 2015 11:47 PM by Subharaman Venkita

# Creating Average for Last 24 Months Based on Date Selected

Hi all,

I need to calculate average of past 24 months based on Date Selected.

well the scenario is if the selected date is 12/Aug/2015 then i need to get all the values between 12/Aug/2015 and 12/Aug/2012 and Averaged those 24 Months Data.

Thanks.

Try

• ###### Re: Creating Average for Last 24 Months Based on Date Selected

EDITED:

Are you looking for 36 Months data or 24 Months?

Use something as below for 24 Months

• ###### Re: Creating Average for Last 24 Months Based on Date Selected

Try like this

Celambarasan

• ###### Re: Creating Average for Last 24 Months Based on Date Selected

If it is 12/Aug/2015 and 12/Aug/2012

Sum({<YearFieldName=, QuarterFieldName=, MonthFieldName=, DateFieldName={">=\$(=AddMonths(Max(DateFieldName), -36))<=\$(=Date(Max(DateFieldName)))"}>} Sales)/36

If it last 24 months then use

Sum({<YearFieldName=, QuarterFieldName=, MonthFieldName=, DateFieldName={">=\$(=AddMonths(Max(DateFieldName), -24))<=\$(=Max(DateFieldName))"}>} Sales)/24

Hopw this helps you.

Regards,

Jagan.

• ###### Re: Creating Average for Last 24 Months Based on Date Selected

Attached is a sample hop this helps