Results 1 to 3 of 3

Thread: [RESOLVED] Divid By Zero Problem

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2007
    Posts
    52

    Resolved [RESOLVED] Divid By Zero Problem

    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:

    Code:
    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
    "Never shall I fail my comrades, nor leave any to fall;
    For we are not separate persons, but one Guardian to All."

  2. #2
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Re: Divid By Zero Problem

    can't find anything that will force that to change.
    I dont know much about ratios but using paranthesis () at appropriate places should help

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2007
    Posts
    52

    Thumbs up Re: Divid By Zero Problem

    I got it figured out. Turns out I had some data segments where the field values actually were zero, and I could easily modify my select statements to weed those out. All good now!
    "Never shall I fail my comrades, nor leave any to fall;
    For we are not separate persons, but one Guardian to All."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width