Placeholder

Customer Forum

Reporting on a rolling 6 month period

Workbooks Support Posted: 2014-09-29 11:35

If you're looking to report on Opportunities which are closing in the last 6 months, you'll find that the calendar range criteria available does not include this option. Instead you'll need to manually add a formula which identifies which Opportunities are closing after the date 6 months ago which you can then apply a criteria on.

Firstly you'll need to calculate the date 6 months ago today, this is achieved using the SUBDATE() MySQL function where you use the following formula:

  • SUBDATE( CURDATE(), INTERVAL 6 MONTH).

With this date now calculated, you'll need to wrap it in an IF statement so that you can identify if an Opportunity close date is before or after this date calculated. If the close date is after the last 6 months, we'll get a 1, if the close date is before the last 6 months, we'll get a 0.

  • IF( SUBDATE( CURDATE(), INTERVAL 6 MONTH) <=  close_date , 1 , 0)

Now that there is a test which tells us which Opportunities are closing after the last 6 months, all that's left now is to apply a calculated criteria on this column which limits results to where the column equals 1, i.e., Opportunities where close date is after the last 6 months.

Finally, you can hide this column by clicking on the arrow of the column header and deselecting the Opportunity Test checkbox. 

Workbooks Support Posted: Thu, 27.11.2014 - 10:32

This idea can extended to any rolling period. Imagine you wanted to report on Opportunities created in the last 3 days. Instead of setting your interval to the last 6 months, you would change it to the last 3 days - see below.

  • IF(SUBDATE( CURDATE(), INTERVAL 3 DAY) <=  created_at ,1,0)