You can use equations in a calculation script to assign a value to a member. The syntax for an equation:
member = mathematical_expression;
member is a member name from the database outline and mathematical_expression is any valid mathematical expression.
Essbase evaluates the expression and assigns the value to the specified member.
In the following example, Essbase cycles through the database, subtracting the values in COGS from the values in Sales, and placing the result in Margin:
Margin = Sales - COGS;
In this example, Essbase cycles through the database, subtracting the values in Cost from the values in Retail, calculating the resulting values as a percentage of the values in Retail, and placing the results in Markup:
Markup = (Retail - Cost) % Retail;
You can also use the > (greater than) and < (less than) logical operators in equations.
In the following example, if February sales are greater than January sales, Sales Increase Flag results in a value of 1; if false, the result is a value of 0:
Sales Increase Flag = Sales -> Feb > Sales -> Jan;