CALENDAR

The CALENDAR function returns a table with a single column named "Date" containing a sequential range of dates between two dates given as arguments (and included in the range).

Syntax

CALENDAR(
    <initial_date>,
    <end_date>
)

Parameters
  • initial_date: Initial date of the range to return.
  • end_date: End date of the range to return.
Returned value

The CALENDAR function returns a table with a single column named "Date" containing a range of dates.

Additional Information

This function can be used to create custom tables as a basis for the time intelligence functions. As in all time functions, the dates involved can be supplied to the CALENDAR function by a function or expression that returns a date in datetime format or as a text string ("2016/1/10"). This last option, in general, should be avoided in order not to receive unexpected results derived from an erroneous interpretation of the format used.

The function returns an error if <initial_date> is later than <end_date>. Both dates can be the same, in which case the function will return a table with a single row corresponding to that date.

If the function is used on a custom column, it will return an error (when trying to insert a table into a cell).

Examples

This example creates a custom table containing as the only column the date range between January 1, 2016 and January 7 of the same year:

CALENDAR function: Example of use

In this example we start from a table ("Ventas") containing sales dates:

CALENDAR function: Sales table

And a custom table is created with start and end dates extracted from the sales table using the MINX and MAXX functions:

CALENDAR function: Example of use

Category
Date and time
Submitted by admin on Mon, 12/03/2018 - 23:29