Current Date Tags
The current-date tag at the beginning of the factory configuration file specifies the date on which the data is current. Time series calculations, such as year-to-date, use this date as the anchor date.
You can use a fixed date or take a date from a file. A format tag is also accepted.
For example:
- current-date "2021/04/19"
- current-date from-file="current-date.txt"
The from-file example expects the text file to be in the factory project's config directory. If you are setting the date from a text file, ensure that the process for creating that text file is in place.
TIP: You can retrieve this date in a Spectre expression using the current_date() function as shown in the following example:
filter `value("Date") != null and value("Date") <= current_date()`
Current Date Tags
Tags | Examples | Notes |
---|---|---|
current-date | current-date "2019/05/12" |
Declares a fixed date as the build date for the factory. This date indicates the data is complete as of this date. |
from-file |
current-date from-file="current-date.txt" |
Obtains the date from a text file located in the factory project's config directory. |
format |
current-date "2019/05/12" format="YYYY/MM/DD" current-date from-file="current-date.txt" format="YYYY-MM-DD" |
Sets the date format. |
fiscal-calendar-start-month | fiscal-calendar-start-month 7 |
Defines the fiscal calendar start month. Takes an integer between 1 and 12. NOTE: In Workbench 7.0(35) and later, you set a fiscal calendar with the calendar type tag—this tag is deprecated. See Calendars Tags and Calendar and Period Types. |
maximum |
current-date from-file="current-date.txt" format="YYYY/MM/DD" { maximum "2020/01/01" } |
Defines a maximum value for the current date. |
minimum |
current-date from-file="current-date.txt" format="YYYY/MM/DD" { minimum "2000/01/01" maximum from-file="date-range-end.txt" } |
Defines a minimum value for the current date. |
See also:
- Factory Configuration File Overview
- Creating a Measure Factory Configuration File
- Factory Configuration File Code Block
- Factory Configuration File Tags