This is a migrated thread and some comments may be shown as answers.

Division always returns zero

2 Answers 206 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 23 Oct 2012, 06:38 PM
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 Answers, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 1
answered on 23 Oct 2012, 09:32 PM
Okay, well I figured out that the numerator has to be cast to a double first, go figure!
0
David
Top achievements
Rank 2
answered on 30 Nov 2012, 01:28 AM
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
Tags
General Discussions
Asked by
Mark
Top achievements
Rank 1
Answers by
Mark
Top achievements
Rank 1
David
Top achievements
Rank 2
Share this question
or