Concepts → Date System Variable

About a date system variable

A date system variable references date or time information. Incorta offers numerous built-in data system variables. A date system variable is available to all users and all services. The Formula Builder gives you access to date system variables when building formula expressions. Incorta calculates a date system variable when invoked.

Invocation of a date system variable

Incorta is an Apache Tomcat web application that runs in a Java Virtual Machine (JVM) on a host machine. By default, the JVM utilizes the host machine’s configurations for date and time.

Because a host machine may exist in another time zone, there is typically a disparity in time between a web browser on a client machine and the JVM running Incorta on the host machine.

When a date system variable is used, Incorta will base the time/date information on the host machine’s designated time zone, not the user. Incorta users should be aware of this fact when creating time sensitive formulas and filters.

Note

See Changing the JVM Time Zone to change the host machine time zone.

Date system variable in a physical schema

If you create a formula column in a physical schema that utilizes a date system variable, the variable is interpreted at load time and stored in memory.



Date system variable in a business schema or dashboard

If you use a date system variable in a business schema or dashboard, the variable is calculated at the time of query.



List of Date System Variables


The following are the available date system variables within Incorta:

VariableData TypeDescriptionExample
$currentDatedateThe current date10/3/20
$currentDayintegerThe current day; displayed as day of month3
$currentMonthintegerThe current month10
$currentMonthEnddateThe last date of the current month10/31/20
$currentMonthStartdateThe first date of the current month10/1/20
$currentQuarterintegerThe numerical value of the current quarter4
$currentQuarterStartdateThe first date of the current quarter10/1/20
$currentTimetimestampTimestamp of current date and time10/7/20, 8:12:14 PM
$currentWeekintegerThe numerical value of the current week of the year40
$currentWeekStartdateThe date of the first day of the current week.9/27/20
$currentYearintegerThe current year2020
$currentYearStartdateThe first date of the current year1/1/20
$dayAgodateThe date of the previous day10/2/20
$lastMonthintegerThe numerical value of the previous month9
$lastMonthStartdateThe first date of the previous month9/1/20
$lastQuarterintegerThe numerical value of the previous quarter3
$lastQuarterStartdateThe first date of the previous quarter7/1/20
$lastWeekintegerThe numerical value of the previous week of the year39
$lastWeekStartdateThe first date of the previous week9/20/20
$lastYearintegerThe previous year2019
$lastYearStartdateThe first date of the previous year1/1/19
$monthAgodateThe date one month ago9/3/20
$nextMonthStartdateThe first date of the next month11/1/20
$quarterAgodateThe date one quarter ago7/3/20
$weekAgodateThe date one week ago9/26/20
$yearAgodateThe date one year ago10/3/19

Date system variable formatting

If you are using a date system variable as the output of a formula column, the format can be edited in the properties panel of the Analyzer. The data type of a date system variable will determine which format properties can be used.

Changing the JVM time zone

You can change the time zone of the host JVM machine. This is an option if your Incorta users are in one time zone and the Incorta host machine is on a different time zone.

Warning

The following steps require command line changes to Incorta Nodes. If you are not comfortable with editing systems from command line contact Incorta support for assistance. Also, you will need to maintain this update between upgrades.

The following are the steps to change the JVM time zone:

  • Backup the file startService.sh located under <incorta_installation_path>/IncortaNode
  • Edit the startService.sh file by identifying the following line:
export JAVA_OPTS="-Xms"$memorySize" -Xmx"$memorySize" -Dfile.encoding=UTF-8"
  • Edit the line to the following (the time zone chosen is for example purposes):
export JAVA_OPTS="-Xms"$memorySize" -Xmx"$memorySize" -Dfile.encoding=UTF-8" -Duser.timezone=America/Los_Angeles
  • The above change needs to be completed in both the loader and analytics nodes.
  • Restart the Incorta services.
  • Complete a full load from staging.