Hi expert.

I have a question, I need to calculate how many days it cost for a document, therefore , it should be like this,

cost days = clearing date - creation date..

how can I implement this calculated key figure by formula variable..

Here cost days should be a key figure, but the clearing date and creation date are the characteristics in the document.

it seems that formula variable by replacement path can not be used, do I have to use the customer exit for this variable ??

any other good ways to calculate the cost days (beside during the data loading or by virtual key figure).

I just want to implement this in the query designer..

Please give a detailed steps if you could, thanks a lot.

## The Best Answer

Hi,

These steps below are for the query designer in BI 7.0:

1. First create a Formula in the Columns.

2. Edit the formula, in the "Available Operands" see for the "Formula Variable".

3. Right Click on the "Formula Variable" folder and then create a new variable.

4. Edi the Formula Variable in the edit screen provide the Description and Technical name; select the processing by as Replacement path.

5. In the reference characteristic select your characteristic "Creation Date".

6. Save the variable.

7. Select the variable into the formula and name the formula as Creation Date.

Repeat the Same steps for the "Clearing Date".

Then create another formula for the Cost days in which you mention as Clearing date (Formula) - Creation Date (Formula).

Hope your issue is solved...

Regards,

Ravi Kanth