IBP Formulas in KF

https://help.sap.com/docs/SAP_INTEGRATED_BUSINESS_PLANNING/bf99e931b8d44aafb4e306ec3602cbdd/b8582c558934753ce10000000a174cb4.html?version=2105&locale=en-US

Standard Functions

SyntaxDetailsExample
IF(intarg , arg2, arg3)Return arg2 if intarg is considered true (not equal to zero), else return arg3.CAPACITYOVERLOADS@PERLOCRES = IF(“CAPADEMANDUTILPCT@PERLOCRES”> 1,1,0)
ISNULL(arg1)Return 1 (= true), if arg1 is set to null.MARKETINGFORECASTQTY@PERPRODCUST = IF(ISNULL(MARKETINGFORECASTQTY@PERPRODCUST), SALESFORECASTQTY@PERPRODCUST, MARKETINGFORECASTQTY@PERPRODCUST)
CASE(arg1, default)CASE(arg1, cmp1, value1, cmp2, value2, …, default)Return value1 if arg1 == cmp1value2 if arg1 == cmp2, and so on, default if there is no match.CASE(SELECTEDOPTION@PERPROD, 1, KF1@PERPROD, 2, KF2@PERRPROD,KF@PERPROD)
ABS(arg)Returns arg, if arg is positive or zero, else –arg.IF(ABS(SUPPLYREV@PERPRODFML – CONSENSUSDEMANDREV@PERPRODFML)/CONSENSUSDEMANDREV@PERPRODFML > 0.2,1,0)
ROUND(double, int)ROUND(123.456, 0) = 123ROUND(123.456, 1) = 123.5ROUND(-123.456, 1) = -123.5ROUND(123.456, -1) = 120KF1@PERPRODLOCSRC = ROUND(KF@ PERPRODLOCSRC, 0)
ROUNDDOWN(double, int)ROUNDDOWN(123.456, -1) = 120ROUNDDOWN(-123.456, -1) = -130KF1@PERPRODLOCSRC = ROUNDDOWN(KF@ PERPRODLOCSRC, 0)
FLOOR(double)FLOOR(35.1) = 35KF1@PERPRODLOC = FLOOR(KF@ PERPRODLOC)
CEIL(double)CEIL(35.1) = 36KF1@PERPRODLOC = CEIL(KF@ PERPRODLOC)
LTRIM(string)LTRIM(string,string)Remove a whitespace prefix from a string. The whitespace characters may be specified in an optional argument. 
RTRIM(string)RTRIM(string,string)Remove trailing whitespace from a string. The whitespace characters may be specified in an optional argument. 
TRIM(string)TRIM(string,string)Remove whitespace from the beginning and end of a string. 
UPPER(arg1)Returns arg1 in upper caseKF1@PERPRODCUST = IF(UPPER( »ATTR1 ») =  »APPROVED », « KF2@PERPRODCUST », NULL)
MIN(arg1,arg2,…)In the case of several input key figures, there is no aggregation; it returns the lowest value of the input key figures.MINCAPACITY@MTHPRODLOC = MIN(« CAPACITYMORNING@MTHPRODLOC », « CAPACITYAFTERNOON@MTHPRODLOC », « CAPACITYNIGHT@MTHPRODLOC »)
MAX(arg1,arg2,…)In the case of several input key figures, there is no aggregation; it returns the highest value of the input key figures.MAXCAPACITY@MTHPRODLOC = MAX(« CAPACITYMORNING@MTHPRODLOC », « CAPACITYAFTERNOON@MTHPRODLOC », « CAPACITYNIGHT@MTHPRODLOC »)

Example

Sample configuration for aggregation of standard deviation

Take the sum of the squares; then calculate the square root of the total:

  1. Calculate the squares:
    1. Square the values:HKF1@PL = PROPAGATEDDEMANDSTDEV@PL ** 2
    2. Sum the squares:HKF1@REQUEST = SUM(HKF1@PL)
  2. Calculate the square root of the total:PROPAGATEDDEMANDSTDEV@REQUEST= HKF1@REQUEST ** 0.5

Example

ISNULL

The ISNULL condition works only when an underlying time series record exists for the planning object.

Imagine that Sales Forecast Quantity and Marketing Forecast Quantity are the stored key figures for planning level PERPROD.

Planning ObjectPeriodKey Figure: Sales Forecast QtyKey Figure: Marketing Forecast Qty
P1Jan 2018100 
P1Mar 2018 100

With the above data, IF(ISNULL(SALESFCSTQTY),1,0) exhibits the following behavior:

PeriodISNULL ValueNotes
Jan 20180January 2018 has the value “100”.
Feb 2018Not evaluatedThe planning object for the time period February 2018 does not exist.
Mar 20181Though there is no value for Sales Forecast Quantity, the Marketing Forecast Quantity key figure (for the same planning level) has a valid value. Therefore, a record exists in the time series for this planning object.

Sample Expressions

Key FigureCalculation Expression
Actuals PriceACTUALSPRICE@REQUEST = IF(“ACTUALSQTY@REQUEST”=0,0, “ACTUALSREV@REQUEST”/“ACTUALSQTY@REQUEST”)
Capacity OverloadsCAPACITYOVERLOADS@PERLOCRES = IF(“CAPADEMANDUTILPCT@PERLOCRES”> 1,1,0)
Capacity UsageCAPAUSAGE@PERPRODLOCRES = “CAPADEMAND@PERPRODLOCRES”*“(IF(CAPASUPPLYPERDEMAND@PERLOCRES”>1,1, “CAPASUPPLYPERDEMAND@PERLOCRES”))
Marketing Forecast ProfitMARKETINGFORECASTPROFIT@PERPRODCUST = “MARKETINGFORECASTREV@PERPRODCUST”- “HMARKETINGFORECASTCOST@PERPRODCUST”
Marketing Forecast QuantityMARKETINGFORECASTQTY@PERPRODCUST = IF(ISNULL(« MARKETINGFORECASTQTY@PERPRODCUST »), « SALESFORECASTQTY@PERPRODCUST », « MARKETINGFORECASTQTY@PERPRODCUST »)
Constrained Versus Consensus Demand RevenueCONSTRAINEDVSCONSENSUSREV@PERPRODFML = IF(ISNULL(« CONSENSUSDEMANDREV@PERPRODFML »)OR « CONSENSUSDEMANDREV@PERPRODFML »=0,0, IF(ABS(« SUPPLYREV@PERPRODFML » – « CONSENSUSDEMANDREV@PERPRODFML »)/ »CONSENSUSDEMANDREV@PERPRODFML » > 0,2,1,0))
Supply QuantitySUPPLYQTY@PERPRODLOC = IF(« HPROJECTEDINVENTORYQTY@PERPRODLOC »>=0, « DEPENDENTDEMANDQTY@PERPRODLOC », « DEPENDENTDEMANDQTY@PERPRODLOC »+ « HPROJECTEDINVENTORYQTY@PERPRODLOC »)
Bill Cost per Area Demand RevenueBILL_COST_PER_AREA@BSCIRTRSCFRCTOUFRUTO2L3AVG_A = IF(isnull(« ASSETAREA5@BSCIRTRSCFRCTOUFRUTO2L3AVG_A ») or « ASSETAREA5@BSCIRTRSCFRCTOUFRUTO2L3AVG_A »=0,0, »BILL_COST5@BSCIRTRSCFRCTOUFRUTO2L3AVG_A »/ »ASSETAREA5@BSCIRT

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *