Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Analysis Server and Reporting Services (2012)
 SSRS 2012 PERCENTAGE CALCULATION

Author  Topic 

Blessed1978
Yak Posting Veteran

97 Posts

Posted - 2014-03-18 : 23:41:24
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

71 Posts

Posted - 2014-03-19 : 11:16:46
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
   

- Advertisement -