
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- « Previous Replies
- Next Replies »
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i don't think it's a qlik issue
probably you see in the db a round version of real number

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Liron, Thanks for your answer.
But i am still on clear on the issue.
But for Qlik , both are .5 , so why different treatment for these two numbers?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Please change the number format as shown below:


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
may be one is using floor and the other is using round?
can you attach a sample?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Khushboo,
Please attach the sample to demonstrate the issue? Thank you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Pallav

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Pallavi,
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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Pallav

- « Previous Replies
- Next Replies »