This page is part of the…

BI
Upgrade Series
sap.com/upgradebi

Overview

This document describes the corrections and changes to the calculation engine in Web Intelligence 4.1 compared to Web Intelligence XI 3.1, XI 3.0, and XIR2 SP06 and SP03. It compares the new behavior of the calculation engine to its behavior in the previous versions.

It also suggests migration strategies for accommodating the calculation engine changes.

It gives a description of the formula rewrite mechanism introduced in 4.1 SP03 to preserve the reports created with an older version, from specific changes.

(Document authored by Pierre Saurel & Pascal Gaulin / Web Intelligence Product Experts)

Table of contents

Introduction

The calculation engine for Web Intelligence was updated for Business Objects XI 3.0 and 3.1 to include several corrections and improvements. These changes are present in the 4.1 releases.


This document describes these changes and the way they might affect the calculation results in Web Intelligence documents.

 

Where() Operator

“Where” operator works on measures

Prior to XI 3.0, the “Where” operator accurately supported conditions on dimensions or detail objects only. Conditions on measures were possible, but did not always return accurate results.


Web Intelligence XI 3.0 fully supports the usage of measures in “Where” conditions.


More details can be found in the documentation.

“Where” operator on measure with a condition on a formula based on a dimension

Previously, dimensions were incorrectly added to the dimensional context of the condition. Now dimensions are only used for the conditional evaluation.


=[Revenue] Where ( DataProviderType(DataProvider([Quarter])) = “Universe”;))

when used in a table with [Quarter], the result of the formula with the condtion was processed without [quarter] in the table (same value replicated for each different quarter).

Document migration:

User can aggregate on  the related dimension in the context of the measure (=[Revenue]  ForAll([Quarter]) Where ( DataProviderType(DataProvider([Quarter])) = “Universe”;))

From BI 4.1 SP03, to ensure that you receive results for this formula that correspond to the previous document versions, the system automatically rewrites the formula using an ad-hoc parameter with the “where” operator to specify the dimension to take into consideration ((=[Revenue] Where ( DataProviderType(DataProvider([Quarter])) = “Universe”;([Quarter]))).

This functionality is available as of BI 4.1 SP03 for documents created using the following versions:

  • XIR2 all releases
  • XI3.0 all releases
  • XI3.1 SP01 RTM and All FPs
  • XI3.1 SP02 RTM and All FPs
  • XI3.1 SP03 RTM
  • XI3.1 SP04 RTM
  • XI3.1 SP05 RTM
  • BI4.0 SP01 RTM and All Patches
  • BI4.0 SP02 RTM and All Patches
  • BI4.0 SP03 RTM and All Patches
  • BI4.0 SP04 RTM and All Patches

For more details, refer to the Automatic Formula Rewrite section, below.

Interaction between a context modifier on a measure aggregation and the “Where” operator

Dimensions were incorrectly added as dimensional contexts into the list of dimensions for the context modifiers that have been applied to a measure. This problem happened when “where” operators that used conditions on dimensions were used on expressions that used measures and context modifiers.


Example:

AggregationFct( [measure] forall([dim1]) ) where ( condition on [dim2])

Was processed as: AggregationFct( [measure] forall([dim1];[dim2]) ) where ( condition on [dim2])

Is now processed as: AggregationFct( [measure] forall([dim1]) ) where ( condition on [dim2])


Interaction between a context modifier on a dimension and the “Where” operator

For a “where” operator with a condition on a dimension applied to an expression on a dimension with context modifier, the dimension of the condition was incorrectly added to the context modifier.


Example:

[dim 1] in ([dim 2]) where( condition on [dim1]) was

Interpreted before as: [dim 1] in ([dim 2],[dim1) where( condition on [dim1]) and is

Interpreted now as: [dim 1] in ([dim 2]) where( condition on [dim1])


Migration:

To get the previous behavior, swap the “where” operator and the context modifier. Example: [dim 1] where( condition on [dim1] ) in ([dim 2]).

“Where” operator is incorrectly applied when outside of an aggregation expression

For a “where” operator with a condition on a dimension outside an aggregation function, the “where” condition was incorrectly applied before the aggregation calculation. The condition is now applied after the aggregation with the respect to calculation accordingly of the parenthesis.


Example:

AggregationFct ([measure]) Where([dim] ..).

Before, where([dim]) was applied on measure before “agregationFct”.

Now, “aggregationFct” is applied on [measure] and the “Where” is applied after.


Migration:

To get the previous behavior, move the “Where” expression inside the parenthesis. Example: AggregationFct ([measure] Where([dim]…))

Filters

NoFilter() function and “In Break” context modifier

When using the NoFilter() function, the filters would be applied when they were not supposed to, if an “In Break” parameter was used. This problem has been fixed and the filters are now ignored, as expected.

Using filters on object details with multiple values

Details can have multiple values. When displayed in a table together with the dimension object which they depend on, they could show #MULTIVALUE (when there are multiple detail values for a single dimension value), unless the “Avoid duplicate row aggregation” table setting has been checked.


Filtering on details with multiple values would not select the individual values on rows where they show as #MULTIVALUE. To work around this issue, it was then necessary to check the “Avoid duplicate row aggregation” table setting.


This problem has been fixed: when a filter is applied to an object detail where it shows as #MULTIVALUE, this will correctly select the actual value.

Example: We have an object [Range] with a detail [Detail] which has multiple values:

We set a filter on [Detail] to select the values “220” (which is part of the #MULTIVALUE) and “350”.


Before the fix: Error: the “220” [Detail] value does not show in the table, although it has been selected in the filter:

After the fix:The “220” [Detail] value will correctly show in the table, even when the “Avoid duplicate row aggregation” setting is unchecked:

Versions where this behavior has changed:

  • XI 3.1 since SP7 patch 3
  • 4.1 since SP4 patch 10, SP5 patch 6, SP6 patch 1 and SP7

Running Calculations

Running calculations will not reset

After 4.1 SP03, the running calculations will not automatically reset for each new section value. As a result, the calculation for the first cell of a block for a particular section value instance is based on the last cell value of the block from the previous section instance.


Before 4.1 SP03, the running calculation was reset for each new section value.

In the example below, the running sum for 2005 (cell in bold) is independent from the running sum for 2004.

After 4.1 SP03, the running calculation for the current section value is based on the calculation from the previous section. In the example below the running sum for 2005(cell in bold) is based on the running sum for 2004.

 

Migration:

To keep the original behavior, specify a list of dimensions as a reset parameter (3rd parameter of the function running[Calculation]):

=RunningSum([Sales Revenue];([State])).

From 4.1 SP03, to ensure that you receive results for this formula that correspond to the previous document version, the system automatically rewrites this formula accordingly (using the keyword “section” as 2nd operand of the running calculation). This function is available only for documents created before XI 2 SP 05.9 versions. For more details, refer to the following section “Automatic formula rewrite” .

Data order in running calculations

A running calculation was not respecting the order of the data but the default order of the result set. The running calculation now takes into account the graphically displayed order of the data (table or chart).


Running calculations in cross tables and reset context

By default “Running Sum” is evaluated in a cross-table following a row direction (from left to right row by row).

With XI.x version, when adding a dimension as reset context (3rd parameter), the “running sum” was improperly evaluated on column based direction (from the top to the bottom column after column).

Now, in this case it is processed following a row direction.

Example: =RunningSum([Sales revenue];([State])),

Previously:  column direction (wrong) processing:

New behavior: row direction processing:

Migration: to get the previous result (processing by column)  with a new version (BI 4.1 SP03), the user can use the value COL as 2nd parameter.

From BI 4.1 SP03.3, to ensure that you receive results for this formula that correspond to the previous document versions, the system automatically rewrites the formula using an ad-hoc parameter FORCE_COL with the “RunningSum” function to force the process order to column in ther body of the cross-table.

This functionality is available as of BI 4.1 SP03.3 for documents created using the following versions:

  • All XI 3.X versions,
  • BI 4.0 patch 2.20, 2.21
  • BI 4.0 SP5 and all patches
  • BI 4.0 SP06 and patches 6.1, 6.2, 6.3, 6.4
  • BI 4.0 SP07
  • BI 4.1
  • BI 4.1 SP1 and patch 1.1

For more details, refer to the section on Automatic Formula Rewrite, below.


Running sums with reset in cross table footers

In cross-table footers, the RunningSum() function will sum up the values of its measure

  • per row if it is in the row footer
  • per column if it is in the column footer


Example:

In the following table, we have a running sum of the measure used in the body, in the column and row footers:

If this running sum has a reset dimension on one of the cross-table axis, then it will reset its value at the end of this axis. On the other axis, the reset dimension will be ignored. For example, in the footer of each row, if the reset dimension is [Year]:

Similarly, with [Quarter], in the footer of each column:

In previous versions, the running sum in the footer of the other axis would give unpredictable results. Typically, with a reset on [Year] in both the row and column footers, the result in the column footers would be meaningless:

Versions where this wrong behavior has been corrected:

  • XI 3.1 since SP6
  • 4.0 since SP4
  • 4.1

Date Functions

LastDayOfWeek() uses Monday as first day of week

To respect the ISO 8601 standard, and to be consistent with the DayNumberOfWeek() function, the LastDayOfWeek() function now considers Monday as the first day of the week instead of Sunday.


Example:

XI R2:  LastDayOfWeek(todate(“05/11/2005”;”MM/dd/yyyy”)) returns 14 May 2005 (Saturday),

XI 3.1: LastDayOfWeek(todate(“05/11/2005”;”MM/dd/yyyy”)) returns 15 May 2005 (Sunday).

Migration:

To keep the original behavior, use the RelativeDate() function:

RelativeDate(LastDayOfWeek(todate(“05/11/2005”;”MM/dd/yyyy”)),-1) returns 14 May 2005 (Saturday).


Wrong time zone for formula with “CurrentDate” and a date field

The time zone of the server was applied to the “CurrentDate” evaluation (instead of UTC) when used with another date field in a formula. It is now evaluated in the UTC time zone.

“Week” function

The function “Week” was returning an incorrect number for when the last day of a leap year is a Monday. (This situation occurs every 28 years).


Before update: Week # of Monday December the 31th of 2012 = 53

After update: Week # of Monday December the 31th of 2012 = 1

“MonthsBetween” function

A set of days over two months was considered a month if the starting day # < ending day # of ending date. This was not working for months ending with day 30 (29/28) compared to a month ending with day 31.


(4.1 SP1 to come) A set of days over two months is now considered a month if the starting day # <=  ending day # and if ending day # is the end of the month and the starting day # > ending day #.


Before fix: MonthsBetween(31/03/2008 , 30/04/2008) =  0

After fix: MonthsBetween(31/03/2008 , 30/04/2008) = 1


Merged Objects

Aggregation functions return correct values for original dimensions inside merged dimensions

Prior to XI R2 SP06, Web Intelligence did not return a correct result in the body of a table when aggregating an original dimension that participates in a merged dimension. (Note that the result is correct when the related dimension is in the table or in a free standing cell).


In the example below, depending on the query , the number of resorts is different. When asked for a count of the resorts from query 1 or 2, Web Intelligence returns the total number of resorts for the merged object instead of the individual object.

After SP03, the system returns the correct count for the queried objects.

 

Aggregation functions can process individual objects inside a merged object

The aggregation function (e.g: Count, Min, Max) applied to an object [A] participating in a merged object, was processed on the value set of the merged object instead of the given object [A]. It is now processed on the original object [A] value set.


Document migration:

To get the previous behavior, you can replace the original object by the merged object.

From BI 4.1 SP03 (patch2 or upper required), to ensure that you receive results for this formula that correspond to the previous version, the system automatically rewrites the formula using an ad-hoc function “useMerged” with the aggregation expression as a parameter to force the use of the merged dimension. This is available on request on BI 4.1 SP03 for reports created with earlier version of XI 3.1 SP03.2. For more details, refer to the following section:Automatic formula rewrite.

Aggregation on a variable based on individual objects inside a merged object

An aggregation on a variable object whose formula is based on an object [A] that is participating in a merged object, was processed based on the merged object instead of the given object [A]. The aggregation is now processed according to the given object [A].


Migration:

To get the previous behavior, replace the original object with the merged object.



Aggregation in free cells of an object participating to a merged object, combined with the Where() operator

In free cells, the aggregation function (e.g.: Count, Min, Max) applied to an object [A] participating to a merged object was processed on the value set of the merged object instead of the given object [A], when the context of this aggregation was modified by the Where() operator.

Workflow example:

  1. We have a first query “Query1” giving a single value for the [Year] dimension and a second query giving two other values for the same dimension.
  2. When in a table, the formula =Count([Query1].[Year]) Where([Query1].[Quarter]=”Q1”) would return 1, which is the correct result.
  3. When in a free cell, the same formula would return 3, which is the result of the merged [Year] dimension (the single value from Query1 + the two values from the second query).

This behavior was found in WebI XI 3.1 SP1 and was corrected in XI 3.1 SP2.

A regression was found in the following versions, when the “Extend merged dimension values” document setting was activated:

  • XI 3.1 SP5 FP5.6
  • XI 3.1 SP6 FP6.3 to FP6.5
  • XI 3.1 SP7

This regression was corrected on the same branches, in later patches.

To get the previous behavior, replace the object with the merged object.

Aggregation of Merged Data from Business Warehouse (BW)

Data fetched from a BW data source have a unique key allowing data with similar values to be treated as different.

In earlier versions of WebI 4.0, this key was wrongly managed when the data was merged, resulting in spurious rows when in a table, such as in the example below.

Example with [Region] as the merged dimension:

Since WebI 4.0 SP5 patch 5, this issue has been corrected. The keys are correctly managed and the above table will show the properly aggregated data with no additional rows:

Versions where this issue has been fixed:

  • 4.0 SP5 patch 5
  • 4.0 since SP6
  • 4.1 since RTM

Merged dimensions combined with dimension objects


When using in the same table a merged dimension and an object participating to that merged dimension, Web intelligence 4.0 will perform an intersection of the values coming from the merged dimension and the values coming from the participating object.


Example: We have two queries, each of them returning a year dimension, which are merged together:

When using the merged year with the year from the 1st query, the intersection of the two objects results in the values 2004 and 2005, while with the year from the 2nd query, the intersection of the two objects results in the values 2005 and 2006:

In version 4.1, this behavior has been modified and Web Intelligence will perform a union instead of an intersection of the values. This new behavior has been implemented to comply with the general behavior of Web Intelligence regarding the use of merged dimensions, where the merged dimension always take precedence over any object participating to that merge, thus showing all values from the merged object.


This new behavior results in the same list of values whatever the query where the object comes from. For instance, in the above example, this will result in the values 2004, 2005 and 2006 whether the year object comes from the 1st or the 2nd query:

Versions where this behavior has changed:

  • XI 3.1 since SP4 patch 3, SP5 patch 3 and SP6
  • 4.0 since SP5 patch 15, SP6 patch 10, SP7 patch 6, SP8 patch 1 and SP9
  • 4.1 since SP1 patch 5, SP2 patch 1 and SP3

Custom sorts on merged objects


When defining a custom sort on an object, this custom sort is propagated to all instances of that object in the Web Intelligence document. This is not the case with simple ascending or descending sorts, which only apply to the block where they are selected.

When merging custom sorted objects, their custom sorts are disabled. The reason is that objects participating to a merge all share the same list of values, which could therefore result in conflicting custom sorts. The custom sorts are automatically re-enabled when the object is unmerged.

Note that it is still possible to define a custom sort on a merged object. This custom sort will apply to all objects participating to the merge.


Example:


1) Before merge, [Query 1].[City] has a custom sort showing Chicago before Boston:



2) After [Query 1].[City] and [Query 2].[City] have been merged, the custom sort on [Query 1].[City] is disabled and does not show either on the merged object:



In some Web Intelligence versions, the custom sorts are not disabled when objects are merged. Instead, the custom sort of the first selected object is applied to the me