Home > Administration Tool > The following Expression always return 0.00% in a custom OBI EE Repor

The following Expression always return 0.00% in a custom OBI EE Repor

January 21st, 2009 Leave a comment Go to comments

Something else, I’ve found. I suggest always adding 1.00* when working with non-integers, just for sake of convenience.

(Customers.”Total Customers” / sum(Customers.”Total Customers”)) * 100
Cause
The problem was caused because that Integer Data Type values are involved in the calculation. If the calculation is performed on Integer values, then the correct answer is ’0′.

When a Grand Total is specified, then the Data Type is promoted to Double Precision. If the operation is performed on a Double Precision field, then non-zero values will be returned.

Solution

The solution to this issue and to ensure that non-zero values can always be returned in an OBI EE Report is by modifying the formula expression as follows: -

e.g. (1.0*Customers.”Total Customers” / sum(Customers.”Total Customers”)) * 100 or 1000*Customers.”Total Customers” / sum(Customers.”Total Customers”)

Categories: Administration Tool Tags: ,
  1. Stacy
    September 8th, 2010 at 16:53 | #1

    This should work as well.

    Cast(Customers.”Total Customers” ) As double)/ sum(Customers.”Total Customers”)) * 100

  1. No trackbacks yet.
You must be logged in to post a comment.