ZoeWashburn
Feb 13th, 2008, 06:06 PM
Hey guys,
I'm working on a report in Crystal 10. I'm trying to calculate a percent based on two fields that are sums of other fields. Here's the basic gist of it:
Code for formula field Ratio:
WhilePrintingRecords;
(SUM({fieldx}, {groupa}, "daily")/SUM({fieldy}, {groupa}, "daily)) * 100
I've tried EvaulateAfter(x), WhilePrintingRecords, assigning the sum fields to variables, you name it. Every time, it gives me a "divide by zero" error. But when I take the Ratio field out, the values for the sum fields are anything but zero! The only thing I can figure is that Crystal is trying to calculate the ratio before the sums are calculated, but I can't find anything that will force that to change.
Any ideas?
Thanks,
Zoe
I'm working on a report in Crystal 10. I'm trying to calculate a percent based on two fields that are sums of other fields. Here's the basic gist of it:
Code for formula field Ratio:
WhilePrintingRecords;
(SUM({fieldx}, {groupa}, "daily")/SUM({fieldy}, {groupa}, "daily)) * 100
I've tried EvaulateAfter(x), WhilePrintingRecords, assigning the sum fields to variables, you name it. Every time, it gives me a "divide by zero" error. But when I take the Ratio field out, the values for the sum fields are anything but zero! The only thing I can figure is that Crystal is trying to calculate the ratio before the sums are calculated, but I can't find anything that will force that to change.
Any ideas?
Thanks,
Zoe