Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display zero in running total formula 4

Status
Not open for further replies.

crachic

Technical User
Dec 27, 2007
46
US
Hello,

I have a running total formula that I am using to sum a field. I have it evaluating only if a certain criteria exists. I also have it resetting at the change of group 1. When the criteria does not exist I want it to display a zero '0'. Currently when the criteria does not exist it displays nothing. I want this running total formula to work like the functionality of the count feature but I need it to sum. Any help would be greatly appreciated.

Thanks,
crachic
 
Use a formula field,
Code:
if isnull(#RunningTotal) then 0
else #RunningTotal


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Madawc,

I created the following formula

if isnull (@Yearly Totals ARP) then 0
else (@Yearly Totals ARP)

@Yearly Totals ARP is the running total.

I check it for errors and I get the message saying that the keyword 'then' is missing and it is highlighting the running total in the first line.

Any thoughts?

-crachic
 
A running total would appear like: {#Yearly Totals ARP}, not with an @ sign. Your formula should be:

if isnull({#Yearly Totals ARP}) then
0 else
{#Yearly Totals ARP}

If you just select the running total from the field list when creating the formula, it will automatically appear correctly.

-LB
 
Thank you LB and Madawc. It works just like the way I want.

-crachic
 
Another solution is to set the Report Option "Convert Other NULL values to default".

If this is unset, then a condtional running total that doesn't meet any criteria is NULL. If you set that option then the running total will display as a 0.

Editor and Publisher of Crystal Clear
 
Thank You chelseatech....Your way was even easier.

I appreciate the reply.

-crachic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top