Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey Guys,
I am facing an issue on trying to fix my client data.
Here is the formula:
round(colA * colB / 100,0.01)
So I am expected to get my result in two decimals.
But this is what I get from Round function.
anything ends with 9, round-up work unexpected.
HI @euriss_sow
Might be, this link helps you.
ex: Round(0.595+ 0.0000000001,0.01)
Hi @euriss_sow !
Try this
num(ori_result,'#,##0.00') as result_new,
Qlik used a binary number-system. This means that many decimal-numbers haven't an exact binary equivalent. In your case the number 0.595 isn't available else the binary of it is a bit smaller and probably like this: 0.594970703 which then leads to your seen rounding. It's not really wrong.
- Marcus
One workaround is to perform rounding before division.
The expression should look like this :
round(colA*colB)/100
Thanks and regards,
Arthur Fong
Hi Marcus,
The figure is exact 0.595.
Not really, see: Rounding Errors - Qlik Community - 1468808
- Marcus
HI @euriss_sow
Might be, this link helps you.
ex: Round(0.595+ 0.0000000001,0.01)
We have tested with this formula
round(11.9*(5/100),0.01) = 0.60
round(11.9*5/100,0.01) = 0.59
what is the difference here?