Tags business rule; create a business rule; create a rule; MDX; PEL; SQL
What are tags?Most business rules in PerformancePoint Planning Business Modeler are written in PerformancePoint Expression Language (PEL). PEL is a unique language that was designed specifically to create business rules, and to manipulate multi-dimensional information in PerformancePoint Planning Server.
PEL provides a great deal of flexibility:
- The PEL compiler can generate SQL or Multidimensional Expressions (MDX); in fact, from the same PEL source, you can generate both and then compare the results.
- Input data can reside in Online Analytical Processing (OLAP) cubes or in relational databases.
- Rule calculations can be performed in the cube using MDX, in a relational database using SQL, or in main memory using one of Planning Business Modeler specialized components.
- Results of calculations can be returned without storage, written to fact tables in the relational database, or written to cells in the model.
Elements of a PEL business rule
There are three basic components of a PEL business rule in Planning Business Modeler.
- The Scope statement
Scope (<enter target dimensions/members here>);
- The calculation statement, often a This statement
This = (<enter the calculations here>);
- The End Scope statement
End scope;
Examples
As with any programming task, syntax is extremely important. For example, each basic component of the rule must end in a semi-colon, and all brackets and parenthesis must consist of a matching pair. For specific information about the PEL language, see the Planning Business Rules Developer Guide.
The following example shows a simple rule that assigns the value “1” to every cell defined in the scope.
// SCOPE statement
SCOPE(
[Scenario].[All Members].[Budget],
[Time].[All Members].[7/2/2000],
[Account].[All Members].[Cons 7100000],
[BusinessProcess].[Standard].[INPUT],
[Entity].[All Members].[Tahoe],
[TimeDataView].[All Members].[PERIODIC],
[Flow].[All Members].[ADD]
);
// Calculation statement
THIS = 1;
// End SCOPE statement
END SCOPE;
The next example is more complex, but notice that it still consists of the same three basic components. This rule creates a forecast for the last three months of the year. The forecast is based on the average actual operating expense for the first nine months of the year.
SCOPE (
[Account].[Corporate].[Operating Expense].LeafMembers,
[BusinessProcess].[Standard].[Input],
[Entity].[SubsidiaryOperation].[MySubsidiary],
[Scenario].[All Members].[Forecast],
[Time].[Monthly].[Month 10 Year 2004]:[Time].[Monthly].[Month 12 Year 2004],
);
// "This" statement uses the Avg function
// To calculate the average of actual operating expenses
// over 9 months
THIS = Avg(
[Time].[Monthly].[Month 1 Year 2004]:[Time].[Monthly].[Month 9 Year 2004],
[Scenario].[All Members].[Actual]
);
// End SCOPE statement
END SCOPE;