VBA Date Functions
AtScale supports a number of Microsoft Visual Basic Analysis (VBA) functions, which can be used in MDX expressions to create dynamic default members on time hierarchies. This enables you to create default members that update automatically over time; for example, the current day. For more information on default hierarchical members, see About Default Hierarchical Members.
Currently, AtScale only supports VBA date functions with Google BigQuery and Snowflake data sources.
AtScale supports the following VBA date functions.
📄️ CurrentTimestamp
Returns the current time for the underlying data warehouse.
📄️ DateAdd
Changes the specified date by the specified interval and number; for
📄️ Day
Returns an integer (1-31) representing the day of the month on which the
📄️ FloorTime
Returns the input timestamp with all time fields set to 00.
📄️ Format
For dates and times only. Defines a format for the expression's return values.
📄️ Month
Returns an integer (1-12) representing the month of the year in which
📄️ MonthEndDate
Returns a date representing the last day of the Gregorian calendar month
📄️ MonthStartDate
Returns a date representing the first day of the Gregorian calendar
📄️ Now
Returns the current date and time (without a timezone), according to the
📄️ PrevMonthStartDate
Given the input date, returns a date representing the first day of the
📄️ PrevQuarterStartDate
Given the input date, returns a date representing the first day of the
📄️ PrevWeekStartDate
Given the input date, returns the date of the first day of the previous
📄️ PrevYearStartDate
Given the input date, returns a date representing the first day of the
📄️ Quarter
Returns an integer (1-4) representing the quarter of the year in which
📄️ QuarterEndDate
Given the input date, returns a date representing the last day of the
📄️ QuarterStartDate
Given the input date, returns a date representing the first day of the
📄️ selectMaxDate
Returns the max value (Date, Timestamp, or Datetime) from the
📄️ TimeStampAdd
Returns a timestamp calculated by adding N DateTimeParts (for
📄️ Week
Returns an integer (1-53) representing the week of the year in which the
📄️ WeekDay
Returns an integer (1-7) representing the day of the week on which the
📄️ WeekEndDate
Given the input date, returns the date of the last day of the week. This
📄️ WeekStartDate
Given the input date, returns the date of the first day of the week.
📄️ Year
Given the input date, returns an integer (0-9999) representing the year.
📄️ YearEndDate
Given the input date, returns a date representing the last day of the
📄️ YearStartDate
Given the input date, returns a date representing the first day of the