Converting Attributes to Time Fields in Data Source Field Specifications

If your data contains time-related fields (attributes) that are not stored in a recognized time format, you can convert the fields to time fields using the Fields tab of the data source configuration. As long as any string field contains date/time data, you can set its type to Time and specify a time pattern recognized by Zoomdata.

Zoomdata uses Java's SimpleDateFormat for time conversions. See SimpleDateFormat.

This is not the recommended method, as described below. Instead, Zoomdata recommends that you convert the data using a derived field, as described in Converting Attributes to Time Fields Using Derived Fields.

Group functionality does not work for fields for which the type is manually set to Time. You cannot specify these fields as the Group, Group By, or Trend fields for a chart.

You can use these fields in filters and apply them as filters on the time bar. However, you may find that the results shown in your chart are incorrect. This may happen because the manually configured time formats are different and, consequently, not in lexicographic order. For example, suppose you have two strings:

  • String 20170801 (August 1, 2017) matches the time format yyyyMMdd.
  • String 08012018 (August 1, 2018) matches the time format MMddyyyy.

When filtering time data by these fields, Zoomdata treats the time values as numbers. So, when filtered in ascending order, 08012018 will sort before 20170801, which is not correct (August 1, 2018 occurred after August 1, 2017, not before). The resulting chart will not be correct.

To convert an attribute field to a time field in the field table of a data source configuration:

  1. Make sure you are logged in as a Zoomdata administrator.

  2. Select (Settings) and then select Sources. The Data Sources page appears.

  3. In the My Data Sources table on the Data Sources page, locate and select the data source configuration you want to edit. The data source configuration wizard appears.

  4. Select the Fields tab in the data source configuration wizard.

  5. Locate the time field in the list of fields.

  6. Change the value in the Type column for the field to Time.

    The Configure column changes to display two selectable drop-down menu lists: Time Pattern and Granularity as well as the Time Zone option.

  7. Specify the time format (pattern) for the field. The Time Pattern list (with Default displayed) provides two options: Default and Custom. Select the Custom option to specify a unique time format in a text box.

  8. Specify a granularity for the time field. The Granularity list lets you select the default unit of time to use for this time field.

    Valid granularities are Millisecond, Second, Minute, Hour, Day, Week, Month or Year. If some of these granularity options do not appear, verify that the granularity specified for this field on the Fields tab is set at the correct granularity level. For each field, the available granularity options include all options starting from Year down to the granularity level specified for this field on the Fields tab.

    The refinement level of the field data in a data store defines the minimum level of granularity that should be set for the field. Specifying granularity for a field that is lower than the refinement level of the field data will not produce a chart with data grouped at the requested lower level. For example, if a field's data is stored in hours, requesting the granularity of that data lower than hours will produce the values up to the hour level, and the more detailed level information will be zeros (i.e., 0 minutes, 0 seconds, and 0 milliseconds).
  9. Specify the time zone for the time field. The Time Zone option lets you select a time zone: The time zone label will be displayed in charts and dashboards for this data source.

  10. When your changes are complete, click Save, Save & Next, or Finish (depending on the tab) to save the data source configuration and close the wizard.