Hi,
I have a table and data set to populate it. I need to calculate
difference between two rows (lets say the number of items below) and
want to show the difference on another column on each row as below.
Does anyone know how to do that?
Table
Name #Items Date Difference
Bla Bla 60 05-06-2006 -40
Bla Bla 100 05-06-2006 20
Bla Bla 80 04-06-2006 0
Regards,
Alp Eren YILMAZAlp Eren schreef:
> Hi,
> I have a table and data set to populate it. I need to calculate
> difference between two rows (lets say the number of items below) and
> want to show the difference on another column on each row as below.
> Does anyone know how to do that?
> Table
> Name #Items Date Difference
> Bla Bla 60 05-06-2006 -40
> Bla Bla 100 05-06-2006 20
> Bla Bla 80 04-06-2006 0
> Regards,
>
> Alp Eren YILMAZ
Alp,
Something like currentmember-nextmember.......
Ronald|||On the Difference column's textbox right click and click on Expressions and
type the folliwing
=Fields!Item.Value - Previous(Fields!Item.Value)
This will give you the desired result.
Sum.
"Alp Eren" wrote:
> Hi,
> I have a table and data set to populate it. I need to calculate
> difference between two rows (lets say the number of items below) and
> want to show the difference on another column on each row as below.
> Does anyone know how to do that?
> Table
> Name #Items Date Difference
> Bla Bla 60 05-06-2006 -40
> Bla Bla 100 05-06-2006 20
> Bla Bla 80 04-06-2006 0
> Regards,
>
> Alp Eren YILMAZ
>|||Hi,
Thanks for the answers, a couple of tips
1- Change the sort order for the table data so you can use Previous
2- To reach the previous row data use Previous(..) function
= Previous( Fields!ColXXX.Value)-Fields!ColXXX.Value
MSDN Reference: http://msdn2.microsoft.com/en-us/ms156372(SQL.90).aspx
3- For the first row, avoid computation with iif and RowNumber(..)
check
Regards,
Alp Eren YILMAZ
No comments:
Post a Comment