From: Andre on
Solved another one. MHasan's solution in this post worked great:
http://dotnet.org.za/derek/archive/2005/12/09/48729.aspx


Andre

From: Andre on
Uri,

I'm wondering if RunningValue can accept criteria? Here is what I can do in
Crystal, and can't figure out how to do in RS: I want to sum the value of a
field called Jan, but where the description = "something". I don't see a
way of doing this with a RunningValue. I tried to add another field to my
dataset but for some reason it always comes up with zero.

This is the expression for the field I added to my dataset:
=IIF(Fields!line_name.Value = "interest income" OR Fields!line_name.Value =
"revenue", Fields!jan.Value, 0)

I also tried to use the RunningValue function with the above formula but it
still returned zero.

Any help is appreciated.

Thanks, Andre

From: Uri Dimant on
Andre
I do not think you can put RunningValue in a dataset

I think it much better to use T-SQL for this

SELECT SUM(CASE WHEN description = "something THEN description END)
FROM tbl
GROUP BY ......



"Andre" <no(a)spam.com> wrote in message
news:%23rhz5sWtKHA.3408(a)TK2MSFTNGP06.phx.gbl...
> Uri,
>
> I'm wondering if RunningValue can accept criteria? Here is what I can do
> in Crystal, and can't figure out how to do in RS: I want to sum the value
> of a field called Jan, but where the description = "something". I don't
> see a way of doing this with a RunningValue. I tried to add another field
> to my dataset but for some reason it always comes up with zero.
>
> This is the expression for the field I added to my dataset:
> =IIF(Fields!line_name.Value = "interest income" OR Fields!line_name.Value
> = "revenue", Fields!jan.Value, 0)
>
> I also tried to use the RunningValue function with the above formula but
> it still returned zero.
>
> Any help is appreciated.
>
> Thanks, Andre


From: Andre on
Are you recommending adding this to my sproc, or adding it to my dataset
with tsql?

The thing with Crystal is that it allows the running total to be reset on
change of another field. My report groups and reports totals per site, and
I need this running total to change when the site changes, and start
totaling again. Keep in mind I need to have the field total with criteria,
not simply sum. How would you do this?

Andre


From: Uri Dimant on
Andre
Is that possible that stored procedure where you calculate totals accetps a
parameter ? Running Totals is pretty costly operation for huge data , just
keep in mind



"Andre" <no(a)spam.com> wrote in message
news:emWWlIjtKHA.3536(a)TK2MSFTNGP06.phx.gbl...
> Are you recommending adding this to my sproc, or adding it to my dataset
> with tsql?
>
> The thing with Crystal is that it allows the running total to be reset on
> change of another field. My report groups and reports totals per site,
> and I need this running total to change when the site changes, and start
> totaling again. Keep in mind I need to have the field total with
> criteria, not simply sum. How would you do this?
>
> Andre
>
>