Wednesday, December 28, 2011

OBIEE 11g: Calculated % always shows up as 0%

While upgrading some of my dashboards from OBIEE 10.1.3.4 to 11.1.1.5, I noticed that some of my calculations in Answers were showing zeros instead of the calculated amount.  The calculation I was trying to perform was to calculate a match rate % for some data based on a field that showed 'MATCH' or 'NO MATCH'.  The original calculation was:

(SUM(CASE BuyPoint.Match WHEN 'MATCH' THEN 1 ELSE 0 END)/COUNT(BuyPoint.Match ))*100

However, this was returning 0% as the result.  This happens when you have an integer in a calculation.  A very easy fix to this is to multiply by 1.0 (don't use 1, as this will not work.  Use 1.0).  The updated calculation below works and provides a meaningful result.

((1.0*SUM(CASE BuyPoint.Match WHEN 'MATCH' THEN 1 ELSE 0 END))/(1.0*COUNT(BuyPoint.Match )))*100


Wednesday, December 14, 2011

OBIEE 11g: "OBIEE content cannot be displayed in an IFrame"

OK, so I started this blog because of the issue of not being able to render an OBIEE page within a Hyperion Web Analysis HTML window.  I needed to do this for some additional functionality required prior to converting the entire Web Analysis dashboard over to OBIEE (still looking at Essbase connectivity with OBIEE to see if it is a viable solution).  I found half the solution on someone's blog, but half the solution doesn't help.  Below are both sides of the solution.  


1)  Locate the instanceconfig.xml file at the location:
[OBIEE_HOME]\instances\instance1\config\OracleBIPresentationServicesComponent\coreapplication_obips1\


Update the instanceconfig.xml file to add the highlighted entry within the "security" tag (possible values are 'allow', 'prohibit' and 'sameDomainOnly'):

<Security>
<InIFrameRenderingMode>allow</InIFrameRenderingMode>
<!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager-->
<ClientSessionExpireMinutes>210</ClientSessionExpireMinutes>
</Security>

Now, this will only get you half way.  You'll still run into the error, which really doesn't help you any. The 2nd piece is as follows:

2)  Edit the 'web.xml' file at the following location:
[OBIEE_HOME]\oracleBI1\bifoundation\web\app\WEB-INF\

Add the following highlighted entry to the file.  The syntax is the opposite of what the syntax for instanceconfig.xml is, since the 'never' means to never block the rendering within IFrame (you can choose 'never' to always allow rendering in the IFrame, or 'differentDomain' to only allow rendering if it is in the same domain).  

 <servlet-mapping>
      <servlet-name>SAWBridge</servlet-name>
      <url-pattern>/saw.dll/*</url-pattern>
   </servlet-mapping>
   
   <servlet-mapping>
      <servlet-name>RelatedContent</servlet-name>
      <url-pattern>/RelatedContent</url-pattern>
   </servlet-mapping>

   <context-param>
   <param-name>oracle.adf.view.rich.security.FRAME_BUSTING</param-name>
   <param-value>never</param-value>
   </context-param>

   <login-config>
    <auth-method>CLIENT-CERT</auth-method>
   </login-config>

3) Now that you've completed both steps, restart the OBIEE System Components using opmnctl (Stop opmnctl and Start opmnctl).  If you need to find this, you'll find it in your start menu on the server under the 'Oracle Business Intelligence' folder, called 'Stop BI Services' and 'Start BI Services' respectively.  












4) Before testing, be sure to clear your browser cache.