Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Bug in frac() function

Hi,

When using the frac() - function  in calculations I have noticed that it "misbehaves".

For example Frac(180.072) should return 0.072 but returns 0.072000000000003. This is quite an annoying problem, and it messes up a lot of my calculations which are dependent on the frac() - function.

Am I applying the frac() - function wrong, or is this a (.... known?) bug in QlikView? Is anyone else experiencing the same issue, and is there a hotfix for it?

I am currently running on QV 11.2 64-bit version.

Thanks,

David

1 Solution

Accepted Solutions
swuehl
MVP
MVP

3 Replies
swuehl
MVP
MVP

I don't think it's a bug, but floating point calculation. See also http://community.qlik.com/blogs/qlikviewdesignblog/2013/12/17/rounding-errors

alexandros17
Partner - Champion III
Partner - Champion III

One way could be

=Right(180.072,index(180.072,'.')+1)

Not applicable
Author

Thanks swuehl!

Really helpful post!

... I guess I flunked my programming class

BR,

David