Friday, February 17, 2012

Differences between two Columns

Has anyone computed a difference between two columns in a matrix agianst
the group by column?
Example
YEAR Diff
2003 2004
Company A 100 200 100
Company B 50 200 150
I posted this question earlier but I don't think I was clear about what
I was asking about. If anyone has any ideas please let me know. This
is a pretty common problem for our reporting efforts so a solution would
be greatly appreciated.
Thanks Ahead of Time
Steve
sfibich@.pfgc.comOne way to compute the difference between two columns is to write a function
(either embedded in the .rdl or as an assembly) and call the function from
the cell that is going to hold the return value.
Using your example and using an embedded function:
In the Tab=Layout of your design, click the menu item 'Report' then click
'Report
Properties'. On the resulting dialog box, click Tab=Code. Type in the
function:
Public Function ColumnDiff (YearAmt1 as integer, YearAmt2 as integer)
RETURN YearAmt2 - YearAmt1
End Function
Then in the Layout of your form: put the following expression in your 'Diff'
cell.
=Code.ColumnDiff(Fields!YearAmt1.Value, Fields!YearAmt2.Value)
Good Luck
Dawn|||Dawn wrote:
> One way to compute the difference between two columns is to write a function
> (either embedded in the .rdl or as an assembly) and call the function from
> the cell that is going to hold the return value.
> Using your example and using an embedded function:
> In the Tab=Layout of your design, click the menu item 'Report' then click
> 'Report
> Properties'. On the resulting dialog box, click Tab=Code. Type in the
> function:
> Public Function ColumnDiff (YearAmt1 as integer, YearAmt2 as integer)
> RETURN YearAmt2 - YearAmt1
> End Function
> Then in the Layout of your form: put the following expression in your 'Diff'
> cell.
> =Code.ColumnDiff(Fields!YearAmt1.Value, Fields!YearAmt2.Value)
> Good Luck
> Dawn
>
>
>
>
>
Thats not exactly what I'm looking for. My data is not structure in a
way that I have two columns of data already split on years, it is one
column depicting dollar values, another column depicting year.
Example Data Result Set:
Year Sales Dollars
2004 1000
2003 1020
2002 900
2001 50
2000 1000
What I would want is to put the data into a Matrix
Example:
Year 2004 2003 diff2004/2003 2002 diff
Dollar Value 1000 1020 -20 900 +30
I am wondering if anyone else is running into any year over year
comparison reports and how they are handling it. If anyone has any
suggestions please let me know.
Thanks

No comments:

Post a Comment