Page tree
Skip to end of metadata
Go to start of metadata

Purpose

To inform the SAP Community on the new Web Intelligence Formula Rewrite Mechanism introduced in BI 4.1 Support Pack 03. Developers have released some information on this in their SAP BusinessObjects Web Intelligence 4.1: Calculation Engine Changes SCN document.

Overview

Overview of what the Rewrite Rules are and how to implement them

What is the Automatic Formula Rewrite Mechanism?

The Mechanism is a set of calculation rules that allow WebI to automatically rewrite report level formulas at view time to workaround known calculation engine changes:

  1. Running Calculations
  2. Where operator on measure
  3. Aggregation functions on individual objects inside a merged object
  4. Running calculation with reset in cross-tables (since 4.1 SP03 patch 3)

Click the links for each rule for a more detailed explanation and example.

Where are the rules?

The Rules are listed in an XML file called:

Formula_migration_rules.xml

Which is located in the following directories:

WINDOWS:

  • WebI Rich Client (32 bit):
    • [BI Install Dir]\SAP BusinessObjects Enterprise XI 4.0\win32_x86\config
    • Example:  C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\config
  • WebI Processing Server (64 bit)
    • [BI Install Dir]\SAP BusinessObjects Enterprise XI 4.0\win64_x64\config
    • Example:  C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win64_x64\config

UNIX:

  • WebI Processing Server (64 bit):
    • <BI Install Dir>/sap_bobj/enterprise_xi40/<os specific dir>/config
    • Example: /build/home/boeuser/BI41/sap_bobj/enterprise_xi40/linux_x64/config

The XML content looks like this:

BEWARE!!!

Modifying this file may have an impact on your Web Intelligence documents. In particular, if you enable the “force” attribute, the formulas in your documents may be rewritten and introduce behaviors and results that you did not expect. 

You should never use the “force” attribute for all your documents, but only for specific documents. In order to do this, you should enable the “force” attribute, open the document, save it and then disable again the “force” attribute.

How are the rules activated?

The rules are configured in the XML file with the "enable" and "force" settings for each rule:

  • Enable set to true: If the version of the WebI document matches a version that is known to have a changed behavior (and hard-coded in the rewrite code), the formula will be rewritten when viewing the WebI document.  If the WebI document is then saved, it will be saved with the new formula and the version is updated so the rewrite rule is no longer applied.
  • Enable set to false: No rewrites will occur regardless of the WebI document version unless "force" is set to true
  • Force set to true: No matter what the version of the viewed WebI document is, the formula will be rewritten. If saved after viewing, the new formula is saved and no longer needs to be rewritten so the rule is no longer applied.
  • Force set to false: No rewrites will occur, unless "enable" is set to true and the document version matches a version the rule is set to be applied to.

BEWARE! You should never use the “force” attribute for all your documents, but only for specific documents. In order to do this, you should enable the “force” attribute, open the document, save it and then disable again the “force” attribute.

What's the difference between Force & Enable?

If set to "true":

  • Enable means that WebI will check the version of the report and if the report is from the version that reset on section, it will rewrite the formula. Enable is set to true by default for all rules.
  • Force means that WebI will force the rewrite regardless of the report version. Force is set to false by default for all rules.

BEWARE! You should never use the “force” attribute for all your documents, but only for specific documents. In order to do this, you should enable the “force” attribute, open the document, save it and then disable again the “force” attribute

Is it possible to tell if or what formulas have been rewritten?

While we see the formula changing in the formula editor, there is no other flag to indicate a formula has been rewritten.  If you now save the report, the change is saved and the automatic rewrite will no longer occur.  It will just load the corrected formula.

If you do NOT save the report, the formula remains set to the original text, but will be automatically rewritten as long as the XML rules are set to TRUE.  

There are some log entries that indicate WebI has loaded the rules, but nothing that indicates which formulas were "rewritten" (this is an excerpt for the RunningSum rewrite with a "force" and "enable" set to true):

SecurityCommand 0/22/use_formula_language granted ? : true

C3QEX_Builder:g_getMigrationOptions

C3QEX_Builder:documentversion=:14.1.3.1257

kqeBuilder.cpp:31:int __cdecl g_getMigrationOptions(void): TraceLog message 14939

kqeBuilder.cpp:174:__thiscall QEBuilder::Private::Private(const class QEDictionary &,const class ibo_ptr<struct ic3FolderDictionary> &,struct ic3UserDocument *,class CubeFormater *,class CubeFormater *): TraceLog message 14940

C3QEX_Builder:migrationOptions=:1 

The line "C3QEX_Builder:migrationOptions=:1" indicates a rule was loaded.  The number indicates which rule was loaded and if it were set to Force or Enable.

The line "C3QEX_Builder:documentversion=:14.1.3.1257" shows what version the WebI document is.

Why are there errors in the WebI logs around the Rule Migration XML?

Note that these errors:

kqeRuleMigrationXmlParser.cpp:60:void __thiscall BORuleMigration::RuleMigrationParser::notifyError(class bo_utf8string) const: TraceLog message 14938

**ERROR:C3QEX_RuleMigrationXmlParser:RULE: : Error(mismatched tag) During XML rules declaration file: Formula_migration_rules.xml [kqeRuleMigrationXmlParser.cpp;60]

Error=RULE: : Error(mismatched tag) During XML rules declaration file: Formula_migration_rules.xml 

may also be seen in the logs due to an extra <\Rule> end tag in the SP03 version of the Force_migration_rules.xml that is not needed (this is an obsolete version of the XML file):  

---------------------------------------------------------------------------------------

<Rules>

              <Rule name="ExtractPlainDimFromWhereCond" enable="true" force="false"/>

              <Rule name="ResetOnSectionForCumulative" enable="true" force="false"/>

              <Rule name="UseMergeDimInAgg" enable="false" force="false"/>

              <Rule name="UseColForCumulativeOnXTabBody" enable="true" force="false">

         </Rules>

----------------------------------------------------------------------------------------

To get rid of the error, remove the </Rule> (highlighted above) since each of the 3 rules are self terminating and do not need the "end" tag.

Related Documents

SAP BusinessObjects Web Intelligence 4.1: Calculation Engine Changes