Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Running Total

0 views
Skip to first unread message

Samuel

unread,
Jul 5, 2004, 12:37:04 AM7/5/04
to
Hi all,

I want to add a Running Total field to a report, but i cant use the function
RunningValue() because the running total is calculated based on the some
other field's value.

I tried to solve this problem by adding a shared variable and a shared
function(to increment the shared variable). This method works fine. But now
i have to add 4 more running totals, so i have to add 4 more shared
variables and 4 more function(because the running total logic different for
each field). So this is not a good idea.

Any method to solve this problem without using a separate function for each
running total?

Thanks,
Samuel


Chris Hays [MSFT]

unread,
Jul 6, 2004, 3:00:38 PM7/6/04
to
You should be able to use RunningValue based on any field value (or
expression).

For example:
=RunningValue(Sum,Fields!Sales.Value,Nothing)

The third argument is the grouping scope on which to reset the running
value. If you're implementing your own running value functionality so that
you can control the resetting, you should instead group on the field on
which you want to reset and use the third argument.

--
My employer's lawyers require me to say:
"This posting is provided 'AS IS' with no warranties, and confers no
rights."

"Samuel" <sam...@photoninfotech.com> wrote in message
news:uCJSJnkY...@tk2msftngp13.phx.gbl...

Samuel

unread,
Jul 7, 2004, 6:19:57 AM7/7/04
to
Hi Chris,

Thanks for your reply.

Actually I want to perform the sum operation for some rows and skip others.
For Example, consider the following data
Date Amount Type

1-1-04 10000 Dr

1-2-04 5000 Cr

1-3-04 10000 Cr

I want to print Dr=10000 and Cr=5000 in the group footer.

Thanks,

Samuel

"Chris Hays [MSFT]" <ch...@online.microsoft.com> wrote in message
news:%23UyDHu4...@TK2MSFTNGP12.phx.gbl...

Chris Hays [MSFT]

unread,
Jul 7, 2004, 2:40:32 PM7/7/04
to
It sounds like you don't actually want a RunningValue at all, but rather a
conditional sum.

Try this:

=Sum(iif(Fields!Type.Value="Dr",Fields!Amount.Value,0))
and
=Sum(iif(Fields!Type.Value="Cr",Fields!Amount.Value,0))

Note: If you really do want a running value, you can do something similar:
=RunningValue(Sum,iif(Fields!Type.Value="Dr",Fields!Amount.Value,0),Nothing)

--
My employer's lawyers require me to say:
"This posting is provided 'AS IS' with no warranties, and confers no
rights."

"Samuel" <sam...@photoninfotech.com> wrote in message

news:OSmyVwAZ...@TK2MSFTNGP09.phx.gbl...

Chris Hays [MSFT]

unread,
Jul 7, 2004, 3:46:48 PM7/7/04
to
Oops, I've been swapping the first two arguments in RunningValue.
Hopefully you read what I meant rather than what I wrote :)


--
My employer's lawyers require me to say:
"This posting is provided 'AS IS' with no warranties, and confers no
rights."

"Chris Hays [MSFT]" <ch...@online.microsoft.com> wrote in message
news:uwUopHFZ...@TK2MSFTNGP11.phx.gbl...

0 new messages