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
 SQL Server 2012 Forums
 Analysis Server and Reporting Services (2012)
 SSRS 2012 PERCENTAGE CALCULATION
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Blessed1978
Yak Posting Veteran

64 Posts

Posted - 03/18/2014 :  23:41:24  Show Profile  Reply with Quote
I would like to retrieve info ON A SSRS 2012 REPORT basED on the below sql

SELECT


Departments, SUM(sale_Amount) 'Sales', (SUM(SALE_Amount) / @sales * 100) AS 'PercentSales'

FROM Employee_Sales

WHERE sold_Date BETWEEN @BeginDate AND @EndDate


How to I calculate the percentage of the sale amount(PERCENTAGESALES). In SSRS 2012 based on tHis query, as you can see I set parameters for begin date and end date. In the about qert I am doing the percentage calculations in management studio, I would like to do in in SSRS.

the @sales parameter is gathered from


select @sales = SUM(SALE_Amount)

FROM EMPLOYEE_Sales

WHERE SOLD_Date BETWEEN @BeginDate AND @EndDate



maunishq
Yak Posting Veteran

Canada
71 Posts

Posted - 03/19/2014 :  11:16:46  Show Profile  Reply with Quote
First create a dataset using this query:
SELECT Departments, SUM(Sale_Amount) AS Sales
FROM Employees_Sales
WHERE Sold_Date BETWEEN @BeginDate AND @EndDate

Now create a tablix. Place Departments in Column 1 and Sales in Column 2.
Now in Column 3, use the expression: =ReportItems!Textbox00.Value * SUM(Sales). -- Here Textbox00 is the name of the textbox
Then Click the cell of Column 3 and Format it as %.
You are done.

=======================
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.03 seconds. Powered By: Snitz Forums 2000