Division always returns zero

3 posts, 0 answers
  1. Mark
    Mark avatar
    12 posts
    Member since:
    Oct 2012

    Posted 23 Oct 2012 Link to this post

    I have an expression that uses division but it always returns zero. Here some examples of what I have tried:

    =RunningValue('group1',Count(Fields.[Short Description])) / Exec('Report1', Count(Fields.[Short Description]))
    Returns 0

    =RunningValue('group1',Count(Fields.[Short Description])) / 64
    Returns 0

    =Count(Fields.[Short Description]) / Exec('DuplicateCARs', Count(Fields.[Short Description]))
    Returns 0

    =(3 /15)
    Returns 0

    The cell is formatted as a number with 2 decimal places assigned.

    The running value does in fact return an int every time, I have tested it. So, why does this expression always return a zero? All other math opperators work fine; addition, multiplication and subtraction.
  2. Mark
    Mark avatar
    12 posts
    Member since:
    Oct 2012

    Posted 23 Oct 2012 Link to this post

    Okay, well I figured out that the numerator has to be cast to a double first, go figure!
  3. DevCraft banner
  4. David
    David avatar
    10 posts
    Member since:
    Apr 2008

    Posted 29 Nov 2012 Link to this post

    Had the same problem, thanks for the tip mate casting to a double worked for me also

    =cDbl(Parameters.TotalOpened.Value) / cDbl(Parameters.TotalSent.Value) * 100
Back to Top