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).
CALENDAR(
<initial_date>,
<end_date>
)
- initial_date: Initial date of the range to return.
- end_date: End date of the range to return.
The CALENDAR function returns a table with a single column named "Date" containing a range of dates.
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).
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: