all groups > sql server reporting services > august 2005 >
You're in the

sql server reporting services

group:

First, Last, Middle ???


First, Last, Middle ??? PeteMitchell
8/31/2005 1:33:08 PM
sql server reporting services: I have a Matrix that always displays two rows of data.
One row show values from Jan 1 of the current year.
The second row shows values for today.

In the foot I show the % the values have changed so YTD with the following
formula:

=(Last(Fields!Core.Value) - First(Fields!Core.Value)) /
First(Fields!Core.Value) * 100

This works great and looks like this:
Date | Core
-----------------------------------
Jan 1 2005 | $400
Aug 31 2005 | $500
-----------------------------------
Footer +25%

I have been asked to add in the value from a year ago today but still
display the change in value from just Jan 1.

Date | Core
-----------------------------------
Aug 31 2004 | $300
Jan 1 2005 | $400
Aug 31 2005 | $500
-----------------------------------
Footer +25% (Diff between Jan 1 and Aug 31 2005)

How would I calc the % change in the footer. My formula will not work as the
"First" value is a year ago today not Jan 1. Is there a "Middle" function ?
:) :)

Thoughts ?

Thanks in Advance

Re: First, Last, Middle ??? GeoSynch
8/31/2005 7:27:33 PM
Try something like this:
=(Last(Fields!Core.Value) - CDate("1/1/"&CStr(Year(First(Fields!Core.Value)))))
/
CDate("1/1/"&CStr(Year(First(Fields!Core.Value)))) * 100


GeoSynch


[quoted text, click to view]

Re: First, Last, Middle ??? GeoSynch
8/31/2005 9:14:21 PM
Actually, it probably shoud be:
=(Last(Fields!Core.Value) - CDate("1/1/"&CStr(Year(Last(Fields!Core.Value)))))
/ CDate("1/1/"&CStr(Year(Last(Fields!Core.Value)))) * 100


GeoSynch


[quoted text, click to view]

Re: First, Last, Middle ??? PeteMitchell
9/1/2005 6:57:01 AM
Thanks a bunch.
How does that work ?
There are two fields in play here : Date and Core

How is that get the Core.value when the Date.value = Jan 1 2005 ?

Pete


[quoted text, click to view]
Re: First, Last, Middle ??? GeoSynch
9/1/2005 8:13:18 PM
CDate("1/1/"&CStr(Year(Last(Fields!Core.Value)))) evaluates thusly:

Last(Fields!Core.Value) = '08/31/2005' data type Date
Year(Last(Fields!Core.Value)) = '2005' data type Integer
CStr(Year(Last(Fields!Core.Value))) converts it to a string value
so that when concatenated with "1/1/" it will evaluate to string value
"1/1/2005"
CDate converts it back to an actual date value of '01/01/2005'


GeoSynch


[quoted text, click to view]

AddThis Social Bookmark Button