This is a very simple document to demonstrate how to use characteristics in a BEx Query as a part of a calculation.
Example: There are two date: Start Date & End Date (characteristics) in the query and we want to use the difference [End Date – Start Date] in a calculation.
So how to we use a data or any other characteristic in a Formula?
I will explain the same step by step with screenshots.
Here I take an example as a Date.
Step 1: Create a new formula.
Step 2: Create a new Formula Variable.
Step 3: Change the Processing Type to “Replacement Path” and select the characteristic to the characteristic which we need as a key figure.
Note: Make sure the characteristic or the part of the characteristic which you want to use as a key figure is numeric.
Step 4: Go to the “Replacement Path” tab and Select the “Replace with” value as “Key”.
Here in the “Offset Setting”, you can specify the offset (position of the character) and the “Offset Length” from where you want to use the value as a key figure.
Example: Date is “20120415” (YYYYMMDD) and let’s say you want to use the “Day” part of the date as a key figure. I.e. 15. So you set the Offset start as 7 and Offset Length as 2. If you to use the whole date as keyfigure, You can use “Offset Start” as 0 and Offset length as 8.
Step 5: In the formula created in Step 1, insert the formula variable which we created and we have the characteristic ready to be used as a key figure or for calculations.
We can use the same procedure show above to use any characteristic as a key figure.