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
 calculating two colums
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

LarryDC
Starting Member

USA
6 Posts

Posted - 06/13/2013 :  21:53:47  Show Profile  Reply with Quote
hello,

I have built a report using the matrix wizard

on the left I have a name the columns are created based on date and I am doing a count on a number field.

example:


names 2013 2012

name1 500 400
name2 100 300
name3 100 100


what I want to do is calculate the difference between the 2013 and 2012 column but this seems impossible. The table would look like this:


names 2013 2012 Difference

name1 500 400 100
name2 100 300 (200)
name3 100 100 0


how can I calculate the 2013 and 2012 column in report builder? there is only one field that I put in the column groups which groups the column into year.

Any help would be appreciated.

Thanks

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 06/14/2013 :  01:27:59  Show Profile  Reply with Quote
Put a subtotal row and write an expression like

=IIF(Inscope("columngroup"),Yourcurrentcountexpression,COUNT(IIF(Fields!datefield.value=Year(Now()),Yourcurrentcountexpression,Nothing))-COUNT(IIF(Fields!datefield.value=Year(Now())-1,Yourcurrentcountexpression,Nothing)))

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
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