

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Rounding off to an integer using NUM
I was trying to round off all my numbers to integer but i came across this problem:
if i use '#,##0.00' in num, i get these numbers:
When we round this off, it should ideally be 16, 27 and 35
But when i use '#,##0' in num, i get these numbers:
- « Previous Replies
- Next Replies »
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe using a second round of integer values:
round(round(sum({<Flag={1}>} Value_N)*10),10)/10
Value_Type | =Date(Date,'MMM''YY') | Jul'16 | Jun'16 | May'16 | Apr'16 | Mar'16 | Feb'16 | Jan'16 | Dec'15 | Nov'15 | Oct'15 | Sep'15 | Aug'15 | Jul'15 | Jun'15 | May'15 | Apr'15 | Mar'15 | Feb'15 | Jan'15 | Dec'14 | Nov'14 | Oct'14 | Sep'14 | Aug'14 | Jul'14 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Detail | 16 | 18 | 17 | 27 | 27 | 35 | 24 | 18 | 11 | 12 | 3 | 2 | 18 | 28 | 29 | 24 | 18 | 19 | 39 | 37 | 40 | 33 | 26 | 11 | 2 |

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Look here for Rounding error issues in QlikView:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is 15.50 rounded? If the underlying data is actually something like 15.4991, rounded to two decimal places, it would be 15.50, but the rounded integer would be 15 instead of 16.
You could also try using round() instead of num() to get the integer value.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Nicole,
I just checked the data in my reporting tables,
It is exact '15.5'
the round function also gives me 15, if i use '1'as the offset.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey please Round() and dont use num() inside for that
i hope it will work

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Please use ceil function:
Ceil(FieldName) as FieldName
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
O/P for this
LOAD Floor(Round(Value)-1) as Value INLINE [
Value
12.6
13.8
14.5
];
Value
12
13
14


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
use round()


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Vijay,
As per my understanding, floor() function rounds the numbers down.
i want it to round as per the logic:
number >= x.5 gives me x+1
and number <x.5 gives me x.
and as i mentioned in the original post,
my numbers from the reporting tables were 15.5, 26.5 and 34.5
but when i round them, i get 15,27 and 35
So why is 15.5 not rounding upto 16?
I have tried using num(), round(), ceil() and now floor() as well.
But i get the same numbers-15,27,35, which are not correct


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Round(), Ceil(), Floor(), Num()- doesn't work!

- « Previous Replies
- Next Replies »