Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 chhavi376
		
			chhavi376
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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: 

 
					
				
		
 swuehl
		
			swuehl
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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 | 
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Look here for Rounding error issues in QlikView:
 Nicole-Smith
		
			Nicole-Smith
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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.
 
					
				
		
 chhavi376
		
			chhavi376
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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.
 
					
				
		
Hey please Round() and dont use num() inside for that
i hope it will work
 saimahasan
		
			saimahasan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi
Please use ceil function:
Ceil(FieldName) as FieldName
O/P for this
LOAD Floor(Round(Value)-1) as Value INLINE [
Value
12.6
13.8
14.5
];
Value
12
13
14
 
					
				
		
 gautik92
		
			gautik92
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		use round()
 
					
				
		
 chhavi376
		
			chhavi376
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 
					
				
		
 chhavi376
		
			chhavi376
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Round(), Ceil(), Floor(), Num()- doesn't work!
