Discussion Board for collaboration related to QlikView App Development.
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
DB-2670.5 is getting converted to 2671.
Any idea why qlik treats these two numbers differently?
khushboo Peswani wrote:
I have checked upto 5 decimals.
In my source data it is 128.500000 and 2670.500000.
Then you may need more decimals - I think QV numbers have a resolution of about 14 digits. Try an expression like
=128.50 - DBvalue -- you will see that you don't get an answer of zero, you will get a (very) small positive number.
Did you read this: Rounding Errors
It explains the rounding "error" problem in more detail.
Sample i cannot attach.
but both these values are from one single column from DB and also they have same number settings.
Both the number settings are integer.
Still one is rounding off other one is not?
In case you want it to round it off to 2 decimal places and load from DB.Try Loading
Round(FieldName,.01) as FieldName
Or if you want to round it off to next Integer like, 128.7 to 129 and 128.3 to 128- Try this
Round(FieldName,1) as FieldName
But please use Round( ) functions everywhere you are loading this field for uniformity.
Thanks for your reply.
But i cant use round functions everywhere in my dashboard.
My questions whats causing this issue. if the DB has values 128.5,2670.5 .How come one gets rounded off and other Does'nt?
Probably it is loading from Db in with Decimals then rounding off on charts differently based on settings on Numbers tab. Make sure its is set to Integer or Decimal on charts based on your preference.
If you use Round() function in the loading script in the way I mentioned (while loading) and then check your Numbers tab for charts to show the field as an Integer, you should be good.
One can't be sure why it is happening, but it seems like Qlik is loading (while loading through script) a decimal data from db like ( 128.50) and it is rounding off differently on different charts based on your settings on 'Numbers' tab.