To Date

The To Date date-time functions return a list of date elements from the same level as the given element, beginning with the first date, up to and including the given date. When generated by the Time Calculation Wizard, a custom member that aggregates this list is also rendered.

The To Date calculations produce:

  • A parameter, which is used to inject a date into the query at runtime. Parameters are also added regardless of the separate 'parameterize all' switch.
  • Custom calculations, which return a custom member for each calculation.
  • Custom lists, which return a list of dates for each calculation.

Depending on the given hierarchy, you may create the following formulations:

  • Year to Date: returns a list of dates from the beginning of the given year, up to and including the selected date. For instance, if the given date is May 21, 2019, a list of all dates from January 1 - May 21 is returned. The YTD custom member will aggregate this list; the YTD custom list will return a list of all dates in the custom set.
  • Quarter to Date: returns a list of dates from the beginning of the given quarter, up to and including the selected date. For instance, all dates from April 1 - May 21, 2019.
  • Month to Date: returns a list of dates from the beginning of the given month, up to and including the selected date. For instance, all dates from May 1 - May 21, 2019.
  • Week to Date: returns a list of dates from the beginning of the given week, up to and including the selected date. For instance, all dates from May 19 - May 21, 2019.

Note: Depending on the date-time type, these calculation options may not be available: for example there is no WTD option when looking at a month attribute.

Examples