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



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”)

No comments:

Post a Comment

Popular Posts