[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More


SAP BI BO Unit or Currency Logic for unknown units

Published on
10,371 Points
Last Modified:
Community Pick

Problem Statement

In an SAP BI BO Integration project when a BO universe is built on a BEx query, there can be an issue of unit & formatted value objects not getting generated in a BO universe for some key figures. This results in an issue whereby the developer won’t be able to display the unit of that particular key figure in any BO report.  

Some key figures won’t make any sense unless there is a unit associated with it.  For ratios and number of days, no unit is expected.  But if the calculation is of a Revenue then Revenue getting displayed as 500 instead of 500 USD (or any other valid currency) will not be meaningful.  Also it would be OK to display 500 * (calculated revenue is in multiple currencies); i.e, if
    Revenue =A+B+C
and if A and B are in different currencies, then resultant currency should be shown as *.  But not displaying any unit/currency at all would be an issue.

Proposed Solution

In the above mentioned scenario, if Revenue is created as a local formula in a BEx query, then there is a possibility that the unit and formatted value objects of Revenue not getting generated in BO Universe.  In this case, we can still arrive at the unit or currency of Revenue by identifying the individual key figures which are part of the Revenue formula. That is, if we have the unit objects of A, B, C key figures available in the universe, then we can arrive at the unit or currency of Revenue.

The table below shows the possible scenarios for currencies of any two key figures and based on their currency values what should be the final currency:

(* indicates multiple currencies;  Null indicates no value;  Not Null indicates some valid currency)
Scenario  Currency 1  Currency 2  If C1=C2  Expected Output
========  ==========  ==========  ========  ===============
1         *           Null        False     *
2         Null        *           False     *
3         *           Not Null    False     *
4         Not Null    *           False     *
5         *           *           True      *
6         Null        Null        True      Null
7         Not Null    Not Null    True      Currency 1
8         Not Null    Not Null    False     *
9         Not Null    Null        False     Currency 1
10        Null        Not Null    False     Currency 2

Open in new window

The following code has been implemented in a Web Intelligence report and covers all the possible above mentioned scenarios.  Here is the formula to be used to evaluate the result of currency combination between two known currencies:
=If(Currency 1="*" Or Currency 2="*" Or (Not (IsNull(Currency 1)) And Not (IsNull(Currency 2)) And (Currency 1<>Currency 2));"*";If((Currency 1=Currency 2) Or IsNull(Currency 2);Currency 1;Currency 2)).

Open in new window

Considering the above example of Revenue=A+B+C, the above logic has to be used twice, once between A and B and a second time between C and previous result of A and B to arrive at the unit/currency of Revenue .

Featured Post

Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

Join & Write a Comment

Learn the basics of Skype For Business in office 365
Please check the video also in regards to recovery of deleted emails from office 365 admin center and through the MFCMAPI tool. I have mentioned each and every step with the proper steps that need to be taken care of.

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month