Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A


Hi BI Experts,

Can anyone help me in writing syntax for FOX CODE in BPS?

I have a requirment to calcuate percentage for current year planned sales based on my Previous year. I should be able to give values at runtime which reflects accordingly.

Thanks in advance,


Former Member
Former Member replied


Create a variable of type characteristic value and user defined variable in BPS for current year planned sales. Keep the replacement type as user defined. Check input required by user and the other check box also. Suppose the variable is "salecurrent"

You must be having some version to defferentiate between planned data and actuals. If not then also no problem.

Create a fox type planning function. Fields to be changed can be the keyfigure name (example sales), year.

First create a local variable (example sale) and fetch the value of salecurrent and store it in sale.

sale = varv (salecurrent).

The calculation would be sale * 100 / {sales, 2008}.

This will calculate the percentage. This result can be stored in some other keyfigure as per your convinence. If you are storing in some other keyfigure (example perc), then the code should look something like

var sale type 0keyfigure. - specify the keyfigure

{perc, 2009} = sale * 100 / {sales, 2008}.

In the above formula, the percentage has been stored in perc keyfigure for the year 2009. You can customize it more according to your requirement.

Please award points if helpful.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question