All data in QlikView and Qlik Sense is stored as dual value. This means that there are no dedicated data types like Integer, Decimal, Text or Boolean.
Dual values consist of two components;
- A text string, used for presenting the value.
- A numerical value, either decimal or integer, used for calculations, selection and sorting
In a date value for example the visual date '2014-05-14' is stored in the text component of the dual value, and the numerical value is 41773 (which is equal to the number of days since 30 Dec 1899). The two components '2014-05-14' and 41773 both represent the same value, and together they describe the value properly.
'2014-05-14' without the underlying number is just a text that look like a date.
41773 without the text value is just a number, without any specific meaning.
For pure text values the numerical part is represented by NULL, which means that dual values representing text does not have a numerical representation.
The Num() formatting function enables to interpret the numerical component of a dual value and display it. = Num( Date#('2014-05-14', 'YYYY-MM-DD') )
= Num( TimeStamp#('2014-05-14 11:23:40', 'YYYY-MM-DD hh:mm:ss') )
= Num( Dual('Twelve', 12) )
= Num( Text('Twelve') )