SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Development Tools
 Reporting Services Development
 SSRC PERCENTAGE ROUNDING
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Blessed1978
Yak Posting Veteran

65 Posts

Posted - 03/19/2014 :  11:02:37  Show Profile  Reply with Quote
I wrote the following SSRS expression to get percentage

I need to roud my results to the mearest hundreath. It is currently returning values as 1245% etc I want to round it to 12%

=sum(Fields!Sales.Value, 2)/Sum(Fields!Sales.Value,"DataSet1") * 100

James K
Flowing Fount of Yak Knowledge

3706 Posts

Posted - 03/19/2014 :  17:00:49  Show Profile  Reply with Quote
You can use the format string "P" to format as percentage - which by default rounds to two decimal digits. I didn't quite follow how the example of 1245 percent becoming 12 percent correlates with your statement that you want to round to the nearest hundredth of a percentage.
Go to Top of Page

maunishq
Yak Posting Veteran

Canada
71 Posts

Posted - 03/20/2014 :  12:48:16  Show Profile  Reply with Quote
It should be =sum(Fields!Sales.Value, 2)/Sum(Fields!Sales.Value,"DataSet1")
and now you can select % from the toolbar menu, so it will be 12.45% and if you do not want the decimals then make it 0 decimals.
So the end result you would have would be 12.

=======================
Not an Expert, Just a learner.
!_(M)_!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000