Using Dates in Arithmetic Expressions


When you use dates in arithmetic expressions, the result can be numeric or it can be a date. The legal operations for dates and the data type of the result are outlined in Table: Legal Operations for Dates.

Legal Operations for Dates

Operation Result
Add or subtract a number from a date Future or prior date
Subtract a date from a date The number of days between the dates.
Add or subtract a number from a time period. The time period at the appropriate interval in the future or the past, similar to the return values of the LEAD or LAG function. The result is NA when there is no dimension value that corresponds to the result. The calculation is made based on the positions of the values in the default status list of the dimension.