Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rounding Issue Of Qlik

Hi All,

I have a scenario where i have converted decimals from DB to integers on application.

At one scenario,

DB – 128.5 is getting converted to

Dashboard- 128

Other Scenario,

DB-2670.5 is getting converted to 2671.

Any idea why qlik treats these two numbers differently?

Khushboo

23 Replies
Not applicable
Author

Hi Jonathan,

See screenshot attached .

round.png

Can you please let me know why this is happening?

Anonymous
Not applicable
Author

Hi khushboo,

I am also getting the same issue, in Qlik it is 128.49999999999997 but in the source data which we have loaded, it is 128.50000000000000.

So is there any update on this. Please let me know asap.

Thanks,

Shivam Agrawal

Not applicable
Author

Sorry Shivam. I just saw your post.

Its rounding issue in Qlik. I actually raised a CR with Qlik Team and got the reply from them .

Integers are stored as exact values, since they are not technically stored as floating point values. To minimize floating point rounding related issues, data can be stored as integers and then divided to get decimal values in the application sheet objects.

To convert decimal values to integers during the data load.

  1. Multiply the decimal value with a power of ten to move the decimal point
  2. Floor the value to remove the decimal part
  3. The result is an integer value

In sheet objects make calculations on the integer values, and then divide the aggregated result to restore the decimal value. 

  1. Make aggregations with the integer values
  2. Divide the aggregated result with the same power of ten as in the data load
  3. The aggregated result is presented as a decimal value

Hope it Helps.

Thanks

Anonymous
Not applicable
Author

Hi khushboo,

The reason qlikview is reading 128.5 as 128.499999 in my application is because of error in my application which is at script level. I was using order by in my script which was causing rounding error, and also it was of no use so I commented it and issue got solved.

Thanks,

Shivam Agrawal