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: 

 
					
				
		
 chhavi376
		
			chhavi376
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I checked that Sunny,
But it doesnt work.
 saimahasan
		
			saimahasan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You can also use Round function:
Round(FieldName)
 
					
				
		
 oknotsen
		
			oknotsen
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		What you seem to be doing is using a format to show the numbers. That has nothing to do with actual rounding the numbers.
Example:
15 will still show as 15.00000 if you use a format as '0.00000'
To round something, you will need to use the round() function (and yes, it actually works if you use it correct). For example:
15.496 used with round() trying to round it to whole numbers would look like round(15.496, 1).
Please note that round works slightly different in Qlik as it does in XLS or many programming languages. Round() in Qlik works with "steps of". So rounding in two decimals would look like round(15.496, 0.01)
 
					
				
		
 chhavi376
		
			chhavi376
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Saima,
Ceil rounds up,
i want it to round as per the logic:
number >= x.5 gives me x+1
and number <x.5 gives me x.
Round() is also giving wrong results
 
					
				
		
 chhavi376
		
			chhavi376
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Onna,
You are right.
But Round is giving me these results:
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
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I guess the point of the article was that the behavior you are seeing is because of the rounding issue. You can try this
=Round(Round(Number, 0.1)), but this will not work perfectly as well.
Using the above code, you should get these
13.50 -> 14
13.46 -> 14
13.44 - > 13
 saimahasan
		
			saimahasan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		can you please upload your QVW
 
					
				
		
 gautik92
		
			gautik92
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		for this round() should work
can yu share the script
 
					
				
		
Can you share the code where you using, so that we can help you
 
					
				
		
 chhavi376
		
			chhavi376
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		These are the backend values:

This is the expression i am using:
round(Sum( {<flag={1},Products-= {'Product1'}, Metric_Type={'abc'} >} Metric_Value_N),1)
This is the output in the table:

