EPM BPC10 Exercise5 BPC Logic Scripts
EPM BPC10 Exercise5 BPC Logic Scripts
Contents
1|Page
1. CREATING TEMPLATE FOR LOGIC
To implement a scenario for creating MDX logic, we would need a template to key-in data. Create a new Report
as shown below using the details:
2|Page
Use the following Screenshot for the Options tab to create the report. Make Sure “Use as input form is
selected”.
Once the report is created the report looks as given below. The formatting is additional.
Note: You can create a sample EPM Formatting excel sheet and use it in any of your EPM reports.
The cells A3 to A6 are not EPM cells and are manually hard coded values.
3|Page
2. MDX LOGIC
Exercise Objective: In this exercise we will work with statistical accounts for script logic. We will multiply two
accounts (ST_VOL and ST_PRC) and populate ST_REV.
In the BPC Admin Console, ensure the above three members in the FT_ACCOUNT dimension.
4|Page
Once done, create another Logic Script with the name Logic1.LGF and type the script as below.
Once the above step is completed add the following script as shown in the Default Logic file ,Validate, and
Save.
Populate values as shown below in the template, which was created earlier. Then click on Save Data.
5|Page
Once the Report is executed the following values would be displayed.
Here, we can validate the calculations and can see that ST_REV is a product of ST_PRC and ST_VOL.
Clear all the values in the above template and save data. We would require a blank template to start with the
next set of exercises.
Save this template in your template folder and name it as Logic Exercises.xlsx.
Note: MDX syntaxes are seldom used, normally we make use of Native SQL only, which is
demonstrated in subsequent sections.
6|Page
3. SQL LOGIC – WHEN, ENDWHEN and REC
In this exercise we will use the above scenario and make use of the syntaxes for When, Endwhen, and Rec.
Create another Logic File name it LOGIC2.LGF and Enter the script as below.
Now enter the values for ST_PRC and ST_VOL and Select Save Data and the values for ST_REV would be
populated.
We can see the same results. Clear all the values in the above template and save data. We would require a
blank template to start with the next set of exercises.
7|Page
4. STATIC SCOPING using XDIM_MEMBERSET
In this Exercise we shall see the use of XDIM_MEMBERSET using hard coding the values.
Create a new Script LOGIC3.LGF as shown below and we will use the scoping for FT_TIME dimension for a
few periods only.
Change the Default Logic again to call the above logic script. (Comment the earlier Logic scripts and include the
present Script).
8|Page
Now enter the values for ST_PRC and ST_VOL and Select Save Data and the values for ST_REV would be
populated.
We can see that the Value for Revenue for 2013.03 is not calculated because of the following condition in the
Script.
9|Page
5. DYNAMIC SCOPING using XDIM_MEMBERSET
In this exercise we shall work with XDIM_MEMBERSET using variables. This will be used for dynamic scoping
of dimension values.
Comment all the scripts in DEFAULT.LGF. Access the template and clear the values for ST_REV. Save Data.
Change the Default Logic again to call the above logic script. (Comment the earlier Logic scripts and include the
present Script). We can see the same results.
Now modify the Volume for 2013.JAN only and do not modify for the other time periods. Save Data.
10 | P a g e
Here, we can see that Revenue for only 2013.01 is calculated. This is because of the XDIM_MEMBERSET is
scoped with %FT_TIME_SET% which implies to calculate only for the time periods where the Values were
changed.
11 | P a g e
6. WORKING WITH FACTOR
In this exercise, modify the EPM report template. Click on Edit Report. In the row axis, click on FT_ACCOUNT
and change the values for this dimension.
Remove ST_PRC, ST_VOL and ST_REV and select the following accounts:
ACC1,ACC2,ACC3,ACC4,ACC5.
Create another Logic File name it LOGIC5.LGF and Enter the script as below.
Change the Default Logic again to call the above logic script. (Comment the earlier Logic scripts and include the
present Script).
In the template, populate the Values for accounts ACC1 and ACC2. Save Data.
After saving the data, when we refresh the work book, we can find that the values for ACC5 have been
populated as shown below.
12 | P a g e
We can see that the Values for ACC5 have been populated with the Sum of ACC1 and ACC2 and Multiplied by
the Factor 2.
Clear all the values in the above template and save data. We would require a blank template to start with the
next set of exercises.
13 | P a g e
7. WORKING WITH DIMENSION PROPERTY
In this Exercise we will deal with the Dimension Member Property in the When is Condition.
Go to BPC Administration and access the dimension FT_ACCOUNT. Click on Edit Structure and add a new
property called COST_ELMNT (length = 1).
Create a new Script with the Code Below and Change the Default Logic as shown in the above exercises
(Comment the earlier Logic scripts and include the present Script).
In the blank template, fill the values as below and click on save data.
14 | P a g e
On saving the data, we can see the following result:
Here, we can find ACC5=(ACC3+ACC4)*3 as the Cost element property of ACC3 and ACC4 is “N”.
Clear all the values in the above template and save data. We would require a blank template to start with the
next set of exercises.
15 | P a g e
8. DYNAMIC SCOPING – XDIM_FILTER using DIM PROPERTY
In this Exercise we will deal with the Dimension Member Property in the When is Condition.
Create a new Script with the Code Below and Change the Default Logic as shown in the above exercises
(Comment the earlier Logic scripts and include the present Script).
In the blank template, fill the values as below and click on save data.
Here, we can find ACC1 and ACC 2 have 200 as the Cost element property of ACC1 and ACC2 is “Y”.
Clear all the values in the above template and save data. We would require a blank template to start with the
next set of exercises.
16 | P a g e
9. SELECTIVE SCOPING USING VARIABLES
In this Exercise we will deal with Selective Scoping using Variables.
Create a new Script with the Code Below and Change the Default Logic as shown in the above exercises
(Comment the earlier Logic scripts and include the present Script).
Here we can see that the values of only ACC1 and ACC are calculated for 2013.002. This is because of the
selective scoping in the code (only ACC1 and ACC2 have the property COST_ELMNT as “Y”).
17 | P a g e
10. DIMENSION MEMBER LOGIC
In this exercise we shall work on the Dimension Member Formulas.
For this exercise we shall add new dimension Members and create a new report template .
In FT_ACCOUNT we shall add new dimension members Namely FUND1,FUND2 and FUND3 as shown
below.
Once the Dimension Members are added, Select edit structure of FT_ACCOUNT and select the “Allow Member
Formulas” Option.
Following the similar procedure as above for FT_CCTR for the creation of COST_101,COST_102 and
COST_103 respectively.
18 | P a g e
Once the Dimension Members are created and the option of Allow Member Formulas is selected we shall
create the member formulas now.
As shown below ,Open the Member formulas for FT_ACCOUNT and create a new formula.
19 | P a g e
Create a new formula for the member FUND3 with the logic given as below with SOLVE_ORDER=10.
Following the same procedure as above create the member formula for the Dimension member COST_103
with solve order 500( screenshots provided below).
20 | P a g e
Once both the Dimension Member formulas are created, process the Dimensions.
Create a new report as below having FT_ACCOUNT as Row Axis Dimension, FT_CCTR as Column Axis
Dimension and rest other Dimensions in the Page Axis Level.
21 | P a g e
The report is created as below.
Enter the Values for FUND1,FUND2 for CC101 and CC102 respectively as below.
Once the Values are added click on Save Data and the values are generated as below.
22 | P a g e
We can find that the data is calculated at the column level but not the row level because of solve order
Solve order for row level axis was 10 and the column level axis was 500.
BPC evaluates the member with the highest solve order first, and calculates it last. Zero is the highest priority.
Now let us interchange the values of solve order for the member formulas
On refreshing the report, we can see the result. The impact of SOLVE_ORDER can be clearly seen.
23 | P a g e
24 | P a g e