Skip to main content

Decimal Values In Qlik Sense And QlikView - April 2019 and earlier

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
ToniKautto
Employee
Employee

Decimal Values In Qlik Sense And QlikView - April 2019 and earlier

Last Update:

May 10, 2022 3:25:39 PM

Updated By:

Jamie_Gregory

Created date:

Feb 8, 2013 3:58:10 AM

QlikView and Qlik Sense use the same underlying Qlik Indexing (QIX) engine, which stores all decimal values as floating-point values, based on the IEEE 754 double-precision floating-point standard. Floating point value is a common way to handle decimal values in computers because it allows for very efficient processing of decimal values and thereby gives good calculation performance.  

The principle is to store the value as an integer part, called mantissa, and then define the decimal position by an exponent. 

User-added image
A floating-point value has a fixed length. 64-bit environments allow for a 17 digit mantissa, which means that a value like 1.75 is stored as 1.7500000000000000. 

Floating-point values are, by definition, not exact values, and the stored value can vary on the last decimal digits. For example, the value 1.75 can be rounded upwards or downwards, but still represent the same decimal value.

1.7500000000000001
1.7500000000000000
1.7499999999999999

The variation on the last decimal digit can occur at any time when the value is being processed. This includes when a value is loaded and stored, and when a calculation or a modification of the value is performed. 

The precision of all numerical values in the QIX engine is 14 digits for April 2019 and earlier.
For later releases, see Decimal Values In Qlik Sense And QlikView - June 2019 and later.

This means that the last three (17-14=3) digits of the decimal value are subject to rounding, and the last three digits can therefore fluctuate during processing. For this reason, decimal values should only be presented with max 14 digits, including integer and decimal parts.  


Num() function can be used to format a loaded value to present within the 14 digit precision. It is possible to display more than 14 digits by statically expanding the number of decimal digits, which means all 17 stored digits can be revealed. It is not recommended to show more than 14 digits to the end-user as this information can be misleading.

User-added image

NOTE1: The leading zero in decimal values smaller than 1 is not included in the 14 digit precision.
NOTE2: Values smaller than 100 have more than 14 digits in the decimal part and therefore these values can not be completely revealed. 


References to more details about floating-point values; 
Wikipedia.org; http://en.wikipedia.org/wiki/IEEE_floating_point
IEEE 754 Standard; http://ieeexplore.ieee.org/xpl/mostRecentIssue.jsp?punumber=4610933

Labels (1)
Version history
Last update:
‎2022-05-10 03:25 PM
Updated by: