Skip to main content

Dual - script and chart function

Dual() combines a number and a string into a single record, such that the number representation of the record can be used for sorting and calculation purposes, while the string value can be used for display purposes.

Syntax:  

Dual(text, number)

Return data type: dual

Arguments:  

Arguments
Argument Description
text The string value to be used in combination with the number argument.
number The number to be used in combination with the string in the string argument.

In Qlik Sense, all field values are potentially dual values. This means that the field values can have both a numeric value and a textual value. An example is a date that could have a numeric value of 40908 and the textual representation '2011-12-31'.

Information noteWhen several data items read into one field have different string representations but the same valid number representation, they will all share the first string representation encountered.
Tip noteThe dual function is typically used early in the script, before other data is read into the field concerned, in order to create that first string representation, which will be shown in filter panes.

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 – let us know how we can improve!