Mirror of Oracle documentation

Converted for search and offline reading. Authoritative source: Oracle. Diagrams and some complex tables are simplified — check the PDF when in doubt.

D

Appendix: Application Specific Custom Functions, Procedures, and Expressions

Assortment Planning Cloud Service uses the RPAS Enterprise Edition Batch Framework to set up the batch process. Refer to the Oracle Retail Assortment Planning Cloud Service Implementation Guide for more details about understanding batch_control files and its uses in the batch process. Any application-specific custom functions are packaged in the RPAS Applications Standard Library (RASL) libraries and those are available to use in the batch_exec_list.txt control file with the service name as ra_custom to trigger those functions and parameter as the function name. The following list of predefined custom functions are available RASL libraries installed as part of RPAS that are used by Item Planning.

This appendix also contains details about special procedures/expressions used in the APCS configuration.

Custom Function: ap_set_datr

The Platform UI feature allows product attributes to be assigned during item creation if the attributes are defined as dimension attributes. This application-level function registers all the loaded product attributes as dimension attributes. It needs to be called each time a new set of product attributes is loaded.

Example:

batch_datr | ra_custom | ap_set_datr

Custom Function: ap_exp_rms_item

This custom function is used to export new items to RMFCS in XML format. It merges and formats the exported files into XML format and uploads to Object Storage.

Example:

exp_rms | ra_custom | ap_exp_rms_item

Custom Function: ap_set_rms_dim

This custom function is used to link the dimension in the domain to the RMFCS item dimension. It sets the domain property, rms_im_levels, with dimension mappings passed as a parameter. If the domain is linked with RMFCS and dimensions are mapped with the example call shown below, then any new DPM positions created for those dimensions will use the reserved numbers from RMFCS for that mapped item. More than one dimension can be mapped using following mapping “rpasDimName:rmsDimName,…“.

Example:

set_rms_sib | ra_custom | ap_set_rms_dim~sku:ITEM,skup:ITEM

Custom Function: ap_exp_alloc

This custom function formats the Standard Exports to the Allocation’s system into the required format, reads the exported file ap_to_alloc.txt and formats, and converts the file as p0itpt.01 (Style only items) or p1itpt.01 (for Style/Color) and uploads to Object Storage.

July 1, 2026 Appendix D-1 of D-11

Appendix D Special Expressions and Procedures Used in APCS Configuration

Example:

exp_alloc | ra_custom | ap_exp_alloc

Custom Function: ap_sib_color

This custom function is used to rename the Style/Color positions using the Style: format for newly created DPM positions as needed by RMFCS integration so that if actual positions are integrated, it will be formalized.

It expects the ap_sib_color.dat file containing the DPM style/color position, style position, and color attribute in the temp directory. It creates the required product hierarchy renaming the file from it and calls eebatch_rename_positions.ksh to rename those positions.

No additional inputs required to call this function.

Example:

batch_sib | ra_custom | ap_sib_color

Special Expressions and Procedures Used in APCS Configuration

This section contains details about the special expressions that are not standard RPAS expressions/procedures but are used in the APCS configuration.

AttributesPickListExpr - Attribute Picklist Expression

This procedure is used to determine a picklist of values from a base string measure along the positions of the specified hierarchy. It also takes in a Filter Boolean as input to control which intersections are to be used to pick data for the picklist.

Syntax:

OUTMEAS AttributesPickListExpr(FILTERMEAS, INPUTMEAS, HIER, OUTFORMAT)

Example:

ADHDLikePoCT AttributesPickListExpr(ADHDLikePoCB,ADHDLikePoCL, “LOC”, “0”)

Expression Parameters:

The following table shows the parameter details for the expression.

Parameter NameParameter
Type
Data TypeDescription
OUTMEASOutputStringOutput Picklist Measure which will be a string
value.
INPUTMEASInputStringInput String Measure containing the picklist
values stored along a hierarchy.
FILTERMEASInputBooleanBoolean measure with the same intersection of
OUTMEAS. It should be set to true for the
intersections picklist that needs to be created.
HIERInputStringHierarchy Name specified as a String constant
along which the picklist values need to be used.
This hierarchy should be present in INPUTMEAS.

July 1, 2026 Appendix D-2 of D-11

Appendix D Special Expressions and Procedures Used in APCS Configuration

Parameter NameParameter
Type
Data TypeDescription
OUTFORMATInputStringOutput format with valid values “0” or “1”. Using
”0” will create a picklist using position names as
picklist internal names and labels as attribute
values. “1” will create a picklist using position
values as name and labels for the picklist.

BopEopCalcExpr - Inventory Roll Calculation Expression

All planning applications typically need to create some batch rules to do inventory roll operations for all their actualized positions. Inventory roll calculations involve Beginning Inventory (BOP) and Ending Inventory (EOP) metrics, where BOP is calculated as lag of EOP (previous periods EOP) and EOP will be calculated from that period BOP plus additional metrics (Receipts, Sales, and so on). RPAS supports the use of the lag function to calculate BOP and creation of a separate expression to calculate EOP.

They normally run as cyclic rules in a batch rule group. Problem is this dual cyclic expression is highly performance intensive if it needs to roll inventory at the item/sku/store level. This is an optimized procedure to do inventory rollup calculations as a single expression instead of using them as cyclic expressions. This procedure can be used only in batch mode and should not be used in workbook calculation cycle rule groups.

Syntax:

EOP:,BOP: BopEopCalcExpr(TODAYINDEX:, INCEOP:, ACTEOP:, TSMASK:, INITIALBOP:)

Example:

EOP:ISWPEOPU,BOP:ISWPBOPU BopEopCalcExpr(TODAYINDEX:DRDVUnElapI, INCEOP:ISDVEOPU, ACTEOP:DRDVEOPU, TSMASK:DRDVEOPB, INITIALBOP:DRDVBOSU)

The above expression is equivalent to running the following two expressions in batch as a cyclic rule group:

ISWPBOPU = if (DRDVEOPB, if (current == first, DRDVBOSU, lag(ISWPEOPU)), ignore)

ISWPEOPU = if (DRDVEOPB, if (DRDVUnElapB, ISWPBOPU + ISDVEOPU, DRTYEOPU), ignore)

Expression Parameters:

The following table shows the parameter details for the expression.

Parameter NameParameter
Type
Data TypeDescription
EOPOutputRealCalculated Ending Inventory value measure.
BOPOutputRealBeginning Inventory value measure, same
intersection as EOPMEAS.
ACTEOPInputRealActual Ending Inventory for Elapsed Periods.
Same Intersection as BOP and EOP.
INCEOPInputRealIncremental Inventory value for UnElapsed
Periods. Same intersection as BOP and EOP.

July 1, 2026 Appendix D-3 of D-11

Appendix D Special Expressions and Procedures Used in APCS Configuration

Parameter NameParameter
Type
Data TypeDescription
TODAYINDEXInputIntegerIndex of Current RPAS Today period. Periods
above this will be copied with actual EOP, periods
after this will be calculated with BOP and
Incremental EOP. Base Intersection higher or
equal to BOP/EOP but should not have the
calendar dimension.
TSMASKInputBooleanIntersections to which inventory roll calculations
need to be performed. Same intersection as BOP
and EOP but without calendar dimension.
INITIALBOPInputRealFirst Period Beginning Inventory value measure.
Same Intersection of BOP and EOP but without
the calendar dimension.

ClusterExpr - Cluster Expression

This procedure is used to define a dynamic cluster based on input parameters.

Syntax:

POINTMEMBERSHIP: , POINTMEMBERSHIPSTR: , CENTROID: ClusterExpr(MEASURE: , METHOD: , NUMCLUSTERS: , CLUSTERHIER: , BYGROUPDIMS: )

Example:

POINTMEMBERSHIP: SCDVBangGrpID, POINTMEMBERSHIPSTR: SCDVBangGrpT, CENTROID: SCDVBangGrpX ClusterExpr(MEASURE: SCDVCmbIdxV, METHOD: “BANG”, NUMCLUSTERS: SCHDMaxPrfGrpU, CLUSTERHIER: “LOC”, BYGROUPDIMS: “CHNL”)

Expression Parameters:

The following table shows the parameter details for the expression.

Parameter NameParameter
Type
Data TypeDescription
POINTMEMBERSHIPOutputIntegerOutput Cluster Group Id at Location
level.
POINTMEMBERSHIPSTROutputStringOutput Cluster Group String at
Location level.
CENTROIDOutputRealOutput Centroid value at Aggregate
level.
MEASUREInputRealInput Score measure at Location
level.
METHODInputStringString constant with valid value,
“BANG” for Bang Algorithm to use.
NUMCLUSTERSInputIntegerNumber of Clusters to Create at
Aggregate of Location level.
CLUSTERHIERInputStringString constant with hierarchy name
of Location hierarchy for which cluster
is created.
BYGROUPDIMSInputStringString constant of dimension name in
Location hierarchy at Aggregate level.

July 1, 2026 Appendix D-4 of D-11

Appendix D Special Expressions and Procedures Used in APCS Configuration

CMNewItemSimilarityV2Expr - Item Similarity Expression

This procedure is a wrapper procedure used for calling AI Foundation functions which calculate the Item Similarity Scores based on Product Attributes and Product Attribute Weights. This similarity score can be internally calculated and used in Demand Transference procedures as input to determine the Demand Transference across similar items. It is also used in Assortment Improvement Procedures using Demand Transference. This procedure is not currently used in the current AP template version but examples are kept for customers using the non-template version.

Syntax:

SIM_OUT CMNewItemSimilarityV2Expr(SIM_IN, PROD_ATTR, ATTR_WGT, DT_MODE, FUNC_FIT, SAME_ITEM_MAP, VALID_ATTR, SIM_MODE)

Example:

BWHDSimOutVp CMNewItemSimilarityV2Expr(BWHDSimInV, ADDVPrdAttT, BWHDAttrWgtV, DRDVDTModeX, BWHDFuncFitB, DRDVSkupMapB, BWHDPrdAttB, DRDVSimModeV)

Expression Parameters:

The following table shows the parameter details for the expression.

Parameter NameParameter
Type
Data TypeDescription
SIM_OUTOutputRealSimilarity score across LHS and RHS
Items at Item/Cluster/RHS Item level.
SIM_INInputRealIt is needed only if a different
Similarity Mode other than 0 is used.
For default Similarity Mode 0, this can
be initialized to 0 which calculates
similarity for all items.
PROD_ATTRInputStringProduct Attribute values at Item/
Product Attribute level.
ATTR_WGTInputRealAttribute Weight at Item/Attribute level.
DT_MODEInputIntegerDemand Transference Mode to
calculate the similarity scores, value
of 4 is for calculating Bi-Directional
Similarity Score, 3 for One Directional
Score.
FUNC_FITInputBooleanFunctional Fit Boolean at Sub-Class/
Product Attribute level.
SAME_ITEM_MAPInputBooleanSame Item mapping across LHS-RHS
Items at LHS-RHS Item level.
VALID_ATTRInputBooleanProduct Attribute Eligibility at Sub-
Class/Attribute level.
SIM_MODEInputRealSimilarity mode at sub-class level with
default value as 0 for similarity values
calculating for all items.

CMDemandSignTranV2Expr - Demand Transference Expression

This procedure is a wrapper procedure used for calling AI Foundation functions which in turn calculate the Demand Transferences and Substitutable Sales Units. It also calculates the

July 1, 2026 Appendix D-5 of D-11

Appendix D Special Expressions and Procedures Used in APCS Configuration

significant similar items and substitutable sales percentage against each similar item based on the similarity scores. It internally calculates the similarity scores using the attribute inputs and uses it to calculate the Demand transference outputs. This procedure is not currently used in the current AP template version but examples are kept for customers using the non-template version.

Syntax:

DT_SIG_SKU_COUNT, DT_SIG_SUB_PCT, DT_SALES, DT_SUB_SALES CMDemandSignTranV2Expr(DT_MASK, SIM_OUT, ITEM_KAD, INPUT_SALES, SAME_ITEM_MAP, ASSORT_ELASTICITY, DT_CUTOFF, DT_GUARD, PROD_ATTR, ATTR_WGT, SIM_MODE, FUNC_FIT, VALID_ATTR)

Example:

BWHDDTSigSkuV, BWHDDTSigSkuVp, BWHDDTSlsU, BWHDDTSubSlsU CMDemandSignTranV2Expr(BWHDRunMaskB, BWH1SimOutVp, BWHDDTKADX, BWHDDTROSU, DRDVSkupMapB, BWHDAssrtElasV, DRDVDTCutOffVp, DRDVDTGuardB, ADDVPrdAttT, BWHDAttrWgtV, DRDVSimModeV, BWHDFuncFitB, BWHDPrdAttB)

Expression Parameters:

The following table shows the parameter details for the expression.

Parameter NameParameter
Type
Data TypeDescription
DT_SIG_SKU_COUNTOutputIntegerSignificant Substitutable Items count
at Item/Cluster level.
DT_SIG_SUB_PCTOutputRealSignificant Sku Substitutable
Percentage at Item/Cluster/RHS Item
level.
DT_SALESOutputRealDemand Transference ROS/Sales at
Item/Cluster level (At same level of
input ROS).
DT_SUB_SALESOutputRealSubstitutable ROS/Sales at Item/
Cluster level.
DT_MASKInputBooleanMask at Sub-class/Cluster level for
which DT needs to be calculated.
SIM_OUTInputRealIt is needed only if different Similarity
Mode other than 0 is used. For default
Similarity Mode 0, this can be
initialized to 0 procedure internally
calculates similarity for all items.
ITEM_KADInputIntegerItem Keep/Add/Drop Status with valid
values as 1 for Add, 2 for Keep, and 3
for Drop Status of Items at Item/
Cluster level.
INPUT_SALESInputRealInitial Forecasted/Historical Sales or
Rate of Sales at Item/Cluster level.
SAME_ITEM_MAPInputBooleanSame Item mapping across LHS-RHS
Items at LHS-RHS Item level.
ASSORT_ELASTICITYInputRealAssortment Elasticity at Sub-Class/
Cluster level.
DT_CUTOFFInputRealDT Cut-Off % at Sub-Class/Cluster
level.

July 1, 2026 Appendix D-6 of D-11

Appendix D Special Expressions and Procedures Used in APCS Configuration

Parameter NameParameter
Type
Data TypeDescription
DT_GUARDInputRealDT Guard Boolean at Sub-Class/
Cluster level.
PROD_ATTRInputStringProduct Attribute values at Item/
Product Attribute level.
ATTR_WGTInputRealAttribute Weight at Item/Attribute level.
SIM_MODEInputRealSimilarity mode at sub-class level with
default value as 0 for similarity values
calculating for all items.
FUNC_FITInputBooleanFunctional Fit Boolean at Sub-Class/
Product Attribute level.
VALID_ATTRInputBooleanProduct Attribute Eligibility at Sub-
Class/Attribute level.

CMAssortImprovementV2Expr - Assortment Improvement using DT Expression

This procedure is a wrapper procedure used for calling AI Foundation functions which in turn use the Demand Transferences and suggest the Improved Assortments after applying Demand Transferences based on the input assortment improvement parameters. This procedure is not currently used in the current AP template version but examples are kept for customers using the non-template version.

Syntax:

OPT_ASSORT, OPT_SALES CMAssortImprovementV2Expr(DT_MASK, INIT_SALES, SAME_ITEM_MAP, SIM_OUT, NEW_ITEM, INIT_ASSORT, IMPROVE_METRIC, ELIGIBLE_ITEM, IMPROVE_COUNT, MIN_TO_KEEP, OPT_MODE, ASSORT_ELASTICITY, ITEM_MANDATORY, OPT_TARGET, PROD_ATTR, ATTR_WGT, SIM_MODE, FUNC_FIT, VALID_ATTR)

Example:

BWHDDTImprAsrtB, BWHDDTImprAsrtU CMAssortImprovementV2Expr(BWHDRunMaskB, BWHDDTInitAsrtU, DRDVSkupMapB, BWH1SimOutVp, BWHDDTNewB, BWHDDTInitAsrtB, BWHDDTMetricImprV, BWHDDTEligB, BWHDDTImprAsrtV, BWHDMinKeepVp, BWHDDTOptModeV, BWHDAssrtElasV, BWHDDTMandB, BWHDDTOptTgtV, ADDVPrdAttT, BWHDAttrWgtV, DRDVSimModeV, BWHDFuncFitB, BWHDPrdAttB)

Expression Parameters:

The following table shows the parameter details for the expression.

Parameter NameParameter
Type
Data TypeDescription
OPT_ASSORTOutputBooleanOptimized Assortment after adding/
removing items based on input
parameters at Item/Cluster level.
OPT_SALESOutputRealOptimized Sales/ROS by calculating
Improved Assortment after applying
Demand Transference at Item/Cluster
level.

July 1, 2026 Appendix D-7 of D-11

Appendix D Special Expressions and Procedures Used in APCS Configuration

Parameter NameParameter
Type
Data TypeDescription
DT_MASKInputBooleanMask at Sub-class/Cluster level for
which Optimized Assortment needs to
be calculated.
INIT_SALESInputRealInitial Forecasted or Historical Sales
or ROS at Item/Cluster level for all
eligible items. It needs Sales/ROS for
both historical and new items.
SAME_ITEM_MAPInputBooleanSame Item mapping across LHS-RHS
Items at LHS-RHS Item level.
SIM_OUTInputRealIt is needed only if different Similarity
Mode other than 0 is used. For default
Similarity Mode 0, this can be
initialized to 0 procedure internally
calculates similarity for all items.
NEW_ITEMInputBooleanNew Items within the Assortment at
Item/Cluster level.
INIT_ASSORTInputBooleanInitial Planned Assortment before
running Assortment Improvement at
Item/Cluster level.
IMPROVE_METRICInputRealMetric to Improve, 1.0 for Sales Units
(at same level of input ROS/Sales).
For Sales Retail or Gross Margin,
multiply it with Sales Price or Price
Margin at Item/Cluster level.
ELIGIBLE_ITEMInputBooleanAll Eligible Items that can be included
into the assortment for improvement
at Item/Cluster level.
IMPROVE_COUNTInputIntegerNumber of Items to be added,
removed, or swapped from the
assortment at Sub-Class/Cluster
level.
MIN_TO_KEEPInputRealMinimum Percentage of Initial
Assortment to Keep during
Assortment Improvement at Sub-
Class/Cluster level.
OPT_MODEInputIntegerOptimization Mode with values 1 for
Add with Swap, 2 for Drop with Swap,
3 for Swap, 4 for Add, and 5 for
Remove at Sub-Class/Cluster level.
ASSORT_ELASTICITYInputRealAssortment Elasticity at Sub-Class/
Cluster level.
ITEM_MANDATORYInputBooleanMandatory Items to Keep after
running Assortment Improvement at
Item/Cluster level.
OPT_TARGETInputRealTarget to Achieve by Swapping
assortments at Sub-Class/Cluster
level.
PROD_ATTRInputStringProduct Attribute values at Item/
Product Attribute level.
ATTR_WGTInputRealAttribute Weight at Item/Attribute level.

July 1, 2026 Appendix D-8 of D-11

Appendix D Special Expressions and Procedures Used in APCS Configuration

Parameter NameParameter
Type
Data TypeDescription
SIM_MODEInputRealSimilarity mode at sub-class level with
default value as 0 for similarity values
calculating for all items.
FUNC_FITInputBooleanFunctional Fit Boolean at Sub-Class/
Product Attribute level.
VALID_ATTRInputBooleanProduct Attribute Eligibility at Sub-
Class/Attribute level.

AssortmentFitExpr - Assortment Fit Wedge Builder Expression

The Wedge Builder special expression provides an assortment of styles, based on the Target Attribute mix, style status, style score, and attribute score. The algorithm only considers style colors that are present in the shopping list.

Interface:

WEDGE AssortmentFitExpr(MASK, SHOP_LIST, PROD_ATTR, PATR_ONE, PATR_TWO, PATR_THREE, PATR_FOUR, PATR_FIVE,TARGET_MAX, TARGET_PATR_MIX,PROD_SCORE, WEDGE_CORE)

Example:

WEDGE:TRDVAsrtSkupB AssortmentFitExpr(MASK:BWWPSdAFB, SHOP_LIST:TRDVOptnB, PROD_ATTR: TRDVPrdAttT, PATR_ONE: TRDVPAtt1T, PATR_TWO: TRDVPAtt2T, PATR_THREE: TRDVPAtt3T, PATR_FOUR: TRDVPAtt4T, PATR_FIVE: TRDVPAtt5T, TARGET_MAX: TRCAOptnMx, TARGET_PATR_MIX: TRCAOptnCt,PROD_SCORE: AIDVOptnRnkV,WEDGE_CORE: TRDVIntentB)

WEDGE: The populated styles in the Wedge based on the Target Attribute Mix. This is the output.

Inputs:

  • MASK: User-defined trigger for the algorithm to recommend the wedge per buying period/ subclass/store cluster.

  • SHOP_LIST: The styles to be considered to be part of the wedge.

  • WEDGE_CORE: Mandatory item.

  • PROD_ATTR: Measure that stores the association of styles with their corresponding attributes.

  • PATR_ONE, PATR_TWO, PATR_THREE, PATR_FOUR, PATR_FIVE: Up to five product attributes can be selected to build the wedge.

  • TARGET_MAX: Total # of style-colors for assort period/subclass/store cluster.

  • TARGET_PATR_MIX: Measure that defines the Target Attribute mix.

  • PROD_SCORE: Each style color has a score. (Lower the better).

Intersections:

  • (skup/strc) - WEDGE, PROD_SCORE, SHOP_LIST, WEDGE_CORE

  • (patt/skup/strc) - PROD_ATTR

  • (scls/strc) - MASK, PATR_ONE, PATR_TWO, PATR_THREE.., TARGET_MAX

July 1, 2026 Appendix D-9 of D-11


In this guide