SQL Server Forums Profile | Register | Active Topics | Members | Search | Forum FAQ Register Now and get your question answered!
 All Forums  SQL Server 2008 Forums  Analysis Server and Reporting Services (2008)  SSRS Report Calculation New Topic  Reply to Topic  Printer Friendly
Author  Topic

Villanuev
Constraint Violating Yak Guru

309 Posts

 Posted - 04/21/2012 :  00:08:34 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 are the headers static? ie always from A1 to A4 and B1 to B4? or is it varying based on input?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/

Villanuev
Constraint Violating Yak Guru

309 Posts

 Posted - 04/21/2012 :  21:49:58 Hi Visakh16, thanks for the reply.. yes, the header is static.

visakh16
Very Important crosS Applying yaK Herder

India
47051 Posts

 Posted - 04/22/2012 :  13:32:06 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 MVPhttp://visakhm.blogspot.com/

Villanuev
Constraint Violating Yak Guru

309 Posts

 Posted - 04/23/2012 :  23:16:32 Thanks for the reply.I modified my scripts and applied these calculation instead of doing in SSRS expression. so far its working.

visakh16
Very Important crosS Applying yaK Herder

India
47051 Posts

 Posted - 04/23/2012 :  23:19:38 ok..thats one way------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
Topic
 New Topic  Reply to Topic  Printer Friendly Jump To: Select Forum General SQL Server Forums       New to SQL Server Programming       New to SQL Server Administration       Script Library       Data Corruption Issues       Database Design and Application Architecture SQL Server 2012 Forums       Transact-SQL (2012)       SQL Server Administration (2012)       SSIS and Import/Export (2012)       Analysis Server and Reporting Services (2012)       Replication (2012)       Availability Groups and DR (2012)       Other SQL Server 2012 Topics SQL Server 2008 Forums       Transact-SQL (2008)       SQL Server Administration (2008)       SSIS and Import/Export (2008)       High Availability (2008)       Replication (2008)       Analysis Server and Reporting Services (2008)       Other SQL Server 2008 Topics SQL Server 2005 Forums       Transact-SQL (2005)       SQL Server Administration (2005)       .NET Inside SQL Server (2005)       SSIS and Import/Export (2005)       Service Broker (2005)       Replication (2005)       High Availability (2005)       Analysis Server and Reporting Services (2005)       Express Edition and Compact Edition (2005)       Other SQL Server Topics (2005) SQL Server 2000 Forums       SQL Server Development (2000)       SQL Server Administration (2000)       Import/Export (DTS) and Replication (2000)       Transact-SQL (2000)       Analysis Services (2000)       MSDE (2000) Development Tools       ASP.NET       Reporting Services Development       Other Development Tools Site Related Forums       Site Related Discussions       Article Discussion       Poll Discussion       The Yak Corral Other Forums       SQL Server 6.5 \ SQL Server 7.0       Other Topics       MS Access       ClearTrace Support Forum Old Forums       CLOSED - General SQL Server       CLOSED - SQL Server 2005/Yukon  -------------------- Home Active Topics Frequently Asked Questions Member Information Search Page
 SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC