Changes
Here is an example of how to recreate the problem :- Create the Database View :
CREATE VIEW DISCO_CALCULATION_VW AS SELECT 1950 AS annual_hours , 52 AS period_divisor , 37.5 AS normal_hours , 10000 AS fte_annual_salary FROM dual
- Create a Discoverer Database Folder on this created View ;
- Create a Discoverer Custom Folder with exactly the same code ;
- On both the folder add the following Calculated Item :
( Normal Hours/Standard Hours )*Fte Annual Salary
whereStandard Hours = Annual Hours/Period Divisor
- Create a Workbook on both the Folders using Discoverer Desktop. The results for the calculated items will be different.
Cause
For the Workbook built on the Discoverer Custom Folder the sql executed is"SELECT 1950, 10000, 37.5, 52, 1950/52, ( 37.5/1950/52 )*10000 FROM DUAL DUAL"
This means that the order given to the calculation is not working logically as expected and as returned in the database view.
Solution
To make the behavior to be the same on both the folders, the order of the calculation evaluated can be forced by changing the calculation from"( 37.5/1950/52 )*10000"
to
"( 37.5/(1950/52))*10000"
which in turns began a modification of the Calculation item Standard Hours from :
Annual Hours/Period Divisor
to
(Annual Hours/Period Divisor)
No comments:
Post a Comment