months

Counts backwards the specified number of months. Can only be used as a duration parameter in for_date_range().

To count forward, eliminate the minus (-).

Syntax

  • months(-x) (counts backwards x months)
  • -months(x) (counts backwards x months)
  • months(x) (counts forward x months)

x is required to be an integer.

Examples

If you view a column with the following formula on October 15th, the function returns the number of clicks between 2013-07-15 to 2013-10-14:
Clicks.for_date_range(today(), months(-3))

The following formula returns the number of clicks between October 1 and December 31:
Clicks.for_date_range(date(2013, 10, 01), months(3))

Was this helpful?
How can we improve it?