Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Please could someone help as I have tried everything I can think of.
I am working in Qlik Sense with lots of data.
Unfortunately Qlik Sense is calculating my results by several decimal places and this is having a knock on effect to my overall calculations.
For example one of my calculations is 21.74 * 10.94 which should equal 237.84
Qlik Sense is calculating it as 21.7434736842105 * 10.94 giving me a result of 237.87
Please could someone advise how I get Qlik Sense to do all my calculations at 2 decimal spaces.
Many Thanks
Kind Regards
Wendy
Hi Wendy,
All calculations are always performed at the maximum available precision, unless you round your numbers manually. So, basically you have 2 options:
1. Round the numbers during the data load:
LOAD
...
round(Price, 0.01) as Price, // rounding
ceil(Qty, 0.01) as Qty, // rounding up
...
2. Round the numbers in each calculation within each measure:
round(Price, 0.01) * round(Qty, 0.01)
or
ceil(Price, 0.01) * ceil (Qty, 0.01)
Cheers,
Oleg Troyansky
Upgrade your Qlik skills at the Masters Summit for Qlik - coming to Boston, MA this October!
It is very common for many tools like Qlik Sense to use full precision on calculations.
However if you want to do rounding (use fewer decimal places) during calculations you could use the Round() function like this:
Round( Round( 21.7434736842105 , 0.01 ) * 10.94 , 0.01)
Which will give you 237.84
Try Using:
=num(Yourcaluculation,'#,##')
Thank you Petter,
This works perfectly.
Kind Regards
Wendy
That isn't working for me.