Skip to main content

second - script and chart function

This function returns an integer representing the second when the fraction of the expression is interpreted as a time according to the standard number interpretation.

Syntax:  

second (expression)

Return data type: integer

When to use it

The second() function is useful when you would like to compare aggregations by second. For example, the function can be used if you would like to see activity count distribution by second.

These dimensions can be created either in the load script by using the function to create a field in a Master Calendar table, or used directly in a chart as a calculated dimension.

Function examples
Example Result

second( '09:14:36' )

returns 36

second( '0.5555' )

returns 55 ( Because 0.5555 = 13:19:55 )

Regional settings

Unless otherwise specified, the examples in this topic use the following date format: MM/DD/YYYY. The date format is specified in the SET DateFormat statement in your data load script. The default date formatting may be different in your system, due to your regional settings and other factors. You can change the formats in the examples below to suit your requirements. Or you can change the formats in your load script to match these examples. For more information, see Modifying app regional settings.

Default regional settings in apps are based on a combination of identity provider settings, system settings, or browser settings. These regional format settings are not related to the language displayed in the Qlik Cloud user interface. Qlik Cloud will be displayed in the same language as the browser you are using.

If you are an app creator, you can set the default region for apps you create. For more information, see Setting your preferred regional settings for creating apps.

Example 1 – Variable

Example 2 – Chart object

Example 3 – Scenario