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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR8 Conditional formula for detailed records 1

Status
Not open for further replies.

elf1

Technical User
Jun 6, 2001
43
US
Hi:

I have a conditional formula to add particular fields together excluding 0 amounts. The problem... all records print regardless of what the formula's are requesting it to do.

Any help appreciated.

James

 
Hi James,
Hmm - you are adding fields together, but only if the fields are not equal to zero. I presume you are doing this to optimize the report performance, so that you don't add zeros unnecessarily. However, the extra time it takes to check to see if a value is zero probably more than offsets any gain, so you are probably better off just adding up all amounts, including the zeros.
If you want to suppress the fields with zeros from printing, you can either do that for the individual field(s)as a format option, or for the entire section that the field(s) is/are in.
I'm not entirely convinced I understand the problem, so please clarify if this is so... Malcolm Wynden
I'm for sale at malcolm@wynden.net
 
Hi Malcolm:

I greatly appreciate your response.

I have a formula {Total Billed YTD} that adds 2 data fields together. This formula is in the detail section of the report. There are many records in the detail that will have 0.00 in these 2 fields. I need to prevent these records from printing because I also have a formula that calculates profit percent and of course I get the "Division by Zero" error.

I tried formatting the Total Billed YTD to Supress Zero but this doesn't work because the formula still tries to calculate the Zero Detail Lines.

Thank You so much for your expertise.

James
 
Probably the easiest way is to exclude the zero amounts from the percentage calculation
//ProfitPercent formula
If {@Total Billed YTD} = 0 then
0
Else
your existing profit percent formula text Malcolm Wynden
I'm for sale at malcolm@wynden.net
 
Greetings Malcom,

Thank you so much for the tip on modifying the Percentage Formula, this worked great.

You have my vote for #1 Tech!

James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top