Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE

Comparison of decimal or timestamp values do not work

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

Comparison of decimal or timestamp values do not work

Last Update:

Nov 8, 2021 6:13:12 AM

Updated By:

Sonja_Bauernfeind

Created date:

Mar 19, 2014 5:19:57 PM

Two identical timestamps are compared in QlikView, but the logical operation indicates that the value are not equal.

comparison of decimal or timestamp 01.png

In QlikView, a properly formatted timestamp is stored as a decimal value. The visual timestamp is represented by an underlying decimal value. By using the Num() function and expanding all available decimal values it is possible to see that the numerical values are different.

comparison of decimal or timestamp 02.png

In QlikView, all decimal values are stored as floating-point values, which by definition are not the exact values. This means that a floating-point value can always fluctuate in value on the last decimal. The fluctuation can occur after any operation or processing of the value, including the actual load from the data source. 

 References to more details about floating-point values:

 

Resolution:


The easiest way is to compare the actual timestamp text instead of the underlying decimal value. This can be done by using the Text() function. 

comparison of decimal or timestamp 03.png

QlikView is optimized for processing of numerical values, so the text comparison could possibly give a negative performance impact on large data quantities with many distinct values. In such case it could be better to try and perform the comparison with integer values. This can be done by multiplying the decimal value and thereafter using Floor() to remove the decimal part of the value. 

comparison of decimal or timestamp 04.png



 

Labels (1)
Contributors
Version history
Last update:
‎2021-11-08 06:13 AM
Updated by: