Custom Duration Format

Constructing a custom duration format

Analytics Plus allows you to use and display the time duration period in various formats. You can customize the duration format at the workspace level (for all the tables in the workspace) or table level (for a particular table).

Note: While importing duration data into Analytics Plus, ensure the duration format is specified as in your source data. You can later change this in your table as required.

Duration format strings

The following table lists all the duration format strings available in Analytics Plus.

StringDescription
Seconds
%sThis string indicates the duration in seconds
%SSSThis string indicates the duration in milliseconds
%SSSSSSThis string indicates the duration in microseconds
Minutes
%mThis string indicates the duration in minutes
Hours
%HThis string indicates the duration in hours
Days
%DThis string indicates the duration in days

Separators

Analytics Plus lets you use any element as a separator for duration. You can also use a different separator for each element. The following are a few examples of standard patterns.

  • 45 days 18 hrs 31 mins 27 secs (Space is used as a separator)
  • 45 days 18:31:27 (Space and colon is used as a separator)
  • 45 days 18.31.27 (Space and period is used as a separator)
  • 45.18:31:27 (Period and colon is used as a separator)

Examples

The following table lists a few examples of different duration format strings.

FormatExample
Single element
%s13456829
%s Sec13456829 Sec
%SSS586
%SSS Millisecond586 Millisecond
%SSSSSS586709
%SSSSSS Microsecond586709 Microsecond
%m86
%m mins86 mins
%H234
%H hrs234 hrs
%D45
%D days45 days
Seconds and milliseconds or microseconds
%s.%SSS13456829.586
%s.%SSSSSS13456829.586709
Hours and minutes
%H:%m234:33
%H.%m234.33
%H hrs %m mins234 hrs 33 mins
%H/%m234/33
Hours, minutes and seconds
%H:%m:%s234:33:44
%H.%m.%s234.33.44
%H hrs %m mins %s secs234 hrs 33 mins 44 secs
%H h %m m %s s234 h 33 m 44 s
%H/%m/%s234/33/44
Days and hours
%D:%H45:18
%D.%H45.18
%D Days %H hrs45 days 18 hrs
%D/%H45/18
Days, hours, minutes and seconds
%D:%H:%m:%s45:18:31:27
%D.%H.%m.%s45.18.31.27
%D days %H hrs %m mins %s secs45 days 18 hrs 31 mins 27 secs
%D/%H/%m/%s45/18/31/27
%D Days %H:%m:%s45 days 18:31:27
%D.%H:%m:%s.%SSSSSS45.18:31:27.586709
In swap position
%m mins %H hrs %D days31 mins 18 hrs 45 days

Customizing duration format column

Analytics Plus lets you customize the duration formats, either at the workspace level (common to all the tables) or table level (for a particular table).

Workspace level

Follow the steps below to use a common duration format for all the tables in the workspace.

  • Open the required workspace's settings page, and navigate to the Format > Duration tab.
  • Choose the preferred format from the available list or enter a custom format in the Enter your format if it is not listed above field, and click OK.
  • Enable the Apply this setting to all existing Tables/Views checkbox to apply the new duration format to all the existing tables in the workspace.
  • Click Save.

Table level

Follow the steps below to change the duration format for a particular table.

  • Open the required table.
  • Select the duration column and click More > Format Column.
  • In the dialog that appears, choose the preferred format from the available list, and click OK.

Editing duration values

To edit the duration column values, follow the steps below.

  • Open the required table.
  • Click the duration icon that appears on mouse over the table cell to be updated. Or double-click the desired cell and click the duration icon.
  • Modify the required values.

Share this post : FacebookTwitter