Skip to main content Skip to complementary content

Date & time fields

If you are working with fields containing date or timestamp information in your app, you can define a number of related attributes of a date, for example, year or week, and use them in your visualization.

Creating date fields in Data manager

Date fields are created automatically for all data fields recognized as a date or a timestamp when you use Add data with the Prepare data option to build your data model in Data manager, or when you click Load data in Data manager.

See: Managing data in the app with the Data manager

If the date or timestamp field is not recognized automatically, you can adjust the input format in the Data manager table editor. You can also set the display format to use in visualizations.

See: Changing field types

Which date & time fields are automatically recognized ?

Date & timestamp fields will be recognized automatically based on your system locale settings. Additionally, the following formats are recognized:

  • M/D/YYYY h:mm
  • D/M/YYYY h:mm TT
  • M/D/YYYY
  • D/MM/YYYY
  • YYYYMMDD
  • YYYYMMDDhhmmss
  • YYYYMMDDhhmmss.fff
  • YYYYMMDDhhmmssK
  • YYYY-MM-DD
  • YYYY-MM-DDThh:mm:ss
  • YYYY-MM-DD-Thh:mm:ss.fff
  • YYYY-MM-DD-Thh:mm:ssK
Format specifier Description
YYYY Year
M, MM Month
D, DD Day
hh Hour
mm Minute
ss Second
fff Millisecond
TT AM or PM
K Timezone
T Divider between date and time. T can not be replaced with another character.

Creating date & time fields in the data load script

If you use the data load editor to build your data model, you need to create a calendar template where you define which fields to derive in the data load script. The derived date & time fields will be generated when the script is run and data is reloaded.

See: Derived fields

Using date & time fields in your app

Date & time fields in visualizations

All date or timestamp fields in the assets panel Fields tab are marked with G, and you can expand them to use the generated date & time fields. You can use them in visualizations, just like any other data field.

Date & time fields in dimensions

You can also use date & time fields when you create a dimension. The date & time fields are listed under the field that they have been generated from.

Date & time fields in expressions

You can use date & time fields in all expressions, for example when you create a measure. The date & time fields are named according to:

[field name].autoCalendar.[date & time field].

  • [field name] is the name of the data field that was used to generate date & time fields.
  • [date & time field] is the date & time field you want to use, for example, Year.

Example:  

Date.autoCalendar.Year

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!