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 2008 Forums
 Analysis Server and Reporting Services (2008)
 SSRS Report Calculation
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Villanuev
Constraint Violating Yak Guru

309 Posts

Posted - 04/21/2012 :  00:08:34  Show Profile  Reply with Quote
Hi guys,


I have an SSRS report with several computation.
I have done already the dataset and I already  have the ssrs report template with corresponding fields using dataset.lateron the users wanted to have a computation on the report.  My question is how to do this computation in SSRS. Do I need to make variable in expression? Need your input guys.

resultset: 
ItemID—1—2—-3--4---TOTAL1 --A1—A2—A3—A4—B1—B2—B3—B4—TOTAL2
11111--9-6--4--5-----24------5-3--2---2-4--3--2--3--24

These are the requirements.:
1.	The number (1) column is the total of A1 and B1
2.	The number(2) column is the total of A2 and B2
3.	(3) column is the total of A3 and B3
4.	(4) column is the total of A4 and B4
5.	TOTAL1 is the total summary of column 1 to 4
6.	TOTAL2 is the total summary of A1 up to B4


I tried this in my expression
Do i need this to place in variable?

for column 1
=Sum(Field!A1.Value)+Sum(Field!B1.Value) up to D1
for column 2
=Sum(Field!A2.Value)+Sum(Field!B2.Value)  up to D2
and so on...

For the TOTAL1 ??
=Sum(Field!1.Value)+Sum(Field!2.Value)+Sum(Field!3.Value)+Sum(Field!4.Value)


thank you in advance..

jov

Edited by - Villanuev on 04/21/2012 01:38:21

visakh16
Very Important crosS Applying yaK Herder

India
47051 Posts

Posted - 04/21/2012 :  12:40:14  Show Profile  Reply with Quote
are the headers static? ie always from A1 to A4 and B1 to B4? or is it varying based on input?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Villanuev
Constraint Violating Yak Guru

309 Posts

Posted - 04/21/2012 :  21:49:58  Show Profile  Reply with Quote
Hi Visakh16,

thanks for the reply.. yes, the header is static.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47051 Posts

Posted - 04/22/2012 :  13:32:06  Show Profile  Reply with Quote
you can achieve this by applying two column groups. First level group will be a dummy group based on last part of header field (ie 1,2,3,etc). second level group will be the actual header field(A1,A2,...). then add a subtotal to tablix column group and you should get the sum for each group (ie 1 as A1 + B1,2 as A2 + B2,....). One accociated question is whether the order of column in result significant?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Villanuev
Constraint Violating Yak Guru

309 Posts

Posted - 04/23/2012 :  23:16:32  Show Profile  Reply with Quote
Thanks for the reply.
I modified my scripts and applied these calculation instead of doing in SSRS expression. so far its working.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47051 Posts

Posted - 04/23/2012 :  23:19:38  Show Profile  Reply with Quote
ok..thats one way

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

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