Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Aggregate data between two dates. Often used in conjunction with dateAttribute() when building KPIs. DateInterval is useful for retrieving values between two dates that break the current views context. For example, say you have a view for the current year, broken down by month. When accessing indicator values you'll see the data limited to the current month. With DateInterval() you can broaden that date range to whatever you want. Also see prev() and next() which are useful for getting adjacent buckets of data. For instance, to compare last month's revenue to this month's revenue.

Code Block
//note that if your data set has multiple date fields this formula may not work. Try date Attribute instead.


//specify dates and return values between them
dateInterval('1/01/2015', '1/15/2015', M_REVENUE)
 
//dynamically calculate dates and return values between them
startDate = 'actualMonth() - 12m'
endDate = 'actualMonth() + 2m - 1d'
dateInterval(startDate, endDate, { M_REVENUE} ) 

...