Google 網路論壇不再支援新的 Usenet 貼文或訂閱項目,但過往內容仍可供查看。

Running Total

瀏覽次數:0 次
跳到第一則未讀訊息

Samuel

未讀,
2004年7月5日 凌晨12:37:042004/7/5
收件者:
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]

未讀,
2004年7月6日 下午3:00:382004/7/6
收件者:
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

未讀,
2004年7月7日 清晨6:19:572004/7/7
收件者:
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]

未讀,
2004年7月7日 下午2:40:322004/7/7
收件者:
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]

未讀,
2004年7月7日 下午3:46:482004/7/7
收件者:
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 則新訊息