Friday, March 9, 2012

How to Sum certain fields in a column

Hi all,
I am new to reporting services. What I am trying to do is display some of
our accounting data in a debit and credit fields. I am using this expression
to display the correct data in the fields:
=Iif(Fields!credit.value,0,Fields!Amount.Value), however at the bottom I want
to sum only the information that was displayed. Does anyone know how to best
achieve this?Hi there Cynthias,
good old days of access ;-)
AFAIK, -- > No there is no way to aggregate the report fields, you should do
this for best practice in your query, to minimize the rendering time, though
the Database Server (if you are using one) is in most cases the smartest
solution.
HTH, Jens Süßmeyer.
"cynthia" <cynthia@.discussions.microsoft.com> schrieb im Newsbeitrag
news:BEA9F4E0-4BCC-40DA-AD06-13F7ECB2537A@.microsoft.com...
> Hi all,
> I am new to reporting services. What I am trying to do is display some of
> our accounting data in a debit and credit fields. I am using this
> expression
> to display the correct data in the fields:
> =Iif(Fields!credit.value,0,Fields!Amount.Value), however at the bottom I
> want
> to sum only the information that was displayed. Does anyone know how to
> best
> achieve this?|||There is more than one way to do it.
One way that I think is particularly clean is to do the following. In your
field list (where you drag a field onto your form) do a right mouse click,
add field. The field can be a field that is not coming from the database but
is an expression. Put in the expression you have below and call it whatever
you want. This field is now indistinguishable from a field that came from
the database. You can sum, group, whatever you want on it.
The second way is to put in this:
=sum(iif(Fields!credit.value,0,Fields!Amount.Value)
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Jens Süßmeyer" <Jens@.sqlserver2005.de> wrote in message
news:%23ThjqK6PFHA.1528@.TK2MSFTNGP09.phx.gbl...
> Hi there Cynthias,
> good old days of access ;-)
> AFAIK, -- > No there is no way to aggregate the report fields, you should
do
> this for best practice in your query, to minimize the rendering time,
though
> the Database Server (if you are using one) is in most cases the smartest
> solution.
> HTH, Jens Süßmeyer.
>
> "cynthia" <cynthia@.discussions.microsoft.com> schrieb im Newsbeitrag
> news:BEA9F4E0-4BCC-40DA-AD06-13F7ECB2537A@.microsoft.com...
> > Hi all,
> > I am new to reporting services. What I am trying to do is display some
of
> > our accounting data in a debit and credit fields. I am using this
> > expression
> > to display the correct data in the fields:
> > =Iif(Fields!credit.value,0,Fields!Amount.Value), however at the bottom I
> > want
> > to sum only the information that was displayed. Does anyone know how to
> > best
> > achieve this?
>

No comments:

Post a Comment