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:
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 Name | Parameter Type | Data Type | Description |
|---|---|---|---|
| OUTMEAS | Output | String | Output Picklist Measure which will be a string value. |
| INPUTMEAS | Input | String | Input String Measure containing the picklist values stored along a hierarchy. |
| FILTERMEAS | Input | Boolean | Boolean measure with the same intersection of OUTMEAS. It should be set to true for the intersections picklist that needs to be created. |
| HIER | Input | String | Hierarchy 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 Name | Parameter Type | Data Type | Description |
|---|---|---|---|
| OUTFORMAT | Input | String | Output 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:
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 Name | Parameter Type | Data Type | Description |
|---|---|---|---|
| EOP | Output | Real | Calculated Ending Inventory value measure. |
| BOP | Output | Real | Beginning Inventory value measure, same intersection as EOPMEAS. |
| ACTEOP | Input | Real | Actual Ending Inventory for Elapsed Periods. Same Intersection as BOP and EOP. |
| INCEOP | Input | Real | Incremental 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 Name | Parameter Type | Data Type | Description |
|---|---|---|---|
| TODAYINDEX | Input | Integer | Index 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. |
| TSMASK | Input | Boolean | Intersections to which inventory roll calculations need to be performed. Same intersection as BOP and EOP but without calendar dimension. |
| INITIALBOP | Input | Real | First 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:
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 Name | Parameter Type | Data Type | Description |
|---|---|---|---|
| POINTMEMBERSHIP | Output | Integer | Output Cluster Group Id at Location level. |
| POINTMEMBERSHIPSTR | Output | String | Output Cluster Group String at Location level. |
| CENTROID | Output | Real | Output Centroid value at Aggregate level. |
| MEASURE | Input | Real | Input Score measure at Location level. |
| METHOD | Input | String | String constant with valid value, “BANG” for Bang Algorithm to use. |
| NUMCLUSTERS | Input | Integer | Number of Clusters to Create at Aggregate of Location level. |
| CLUSTERHIER | Input | String | String constant with hierarchy name of Location hierarchy for which cluster is created. |
| BYGROUPDIMS | Input | String | String 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 Name | Parameter Type | Data Type | Description |
|---|---|---|---|
| SIM_OUT | Output | Real | Similarity score across LHS and RHS Items at Item/Cluster/RHS Item level. |
| SIM_IN | Input | Real | It 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_ATTR | Input | String | Product Attribute values at Item/ Product Attribute level. |
| ATTR_WGT | Input | Real | Attribute Weight at Item/Attribute level. |
| DT_MODE | Input | Integer | Demand Transference Mode to calculate the similarity scores, value of 4 is for calculating Bi-Directional Similarity Score, 3 for One Directional Score. |
| FUNC_FIT | Input | Boolean | Functional Fit Boolean at Sub-Class/ Product Attribute level. |
| SAME_ITEM_MAP | Input | Boolean | Same Item mapping across LHS-RHS Items at LHS-RHS Item level. |
| VALID_ATTR | Input | Boolean | Product Attribute Eligibility at Sub- Class/Attribute level. |
| SIM_MODE | Input | Real | Similarity 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 Name | Parameter Type | Data Type | Description |
|---|---|---|---|
| DT_SIG_SKU_COUNT | Output | Integer | Significant Substitutable Items count at Item/Cluster level. |
| DT_SIG_SUB_PCT | Output | Real | Significant Sku Substitutable Percentage at Item/Cluster/RHS Item level. |
| DT_SALES | Output | Real | Demand Transference ROS/Sales at Item/Cluster level (At same level of input ROS). |
| DT_SUB_SALES | Output | Real | Substitutable ROS/Sales at Item/ Cluster level. |
| DT_MASK | Input | Boolean | Mask at Sub-class/Cluster level for which DT needs to be calculated. |
| SIM_OUT | Input | Real | It 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_KAD | Input | Integer | Item 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_SALES | Input | Real | Initial Forecasted/Historical Sales or Rate of Sales at Item/Cluster level. |
| SAME_ITEM_MAP | Input | Boolean | Same Item mapping across LHS-RHS Items at LHS-RHS Item level. |
| ASSORT_ELASTICITY | Input | Real | Assortment Elasticity at Sub-Class/ Cluster level. |
| DT_CUTOFF | Input | Real | DT 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 Name | Parameter Type | Data Type | Description |
|---|---|---|---|
| DT_GUARD | Input | Real | DT Guard Boolean at Sub-Class/ Cluster level. |
| PROD_ATTR | Input | String | Product Attribute values at Item/ Product Attribute level. |
| ATTR_WGT | Input | Real | Attribute Weight at Item/Attribute level. |
| SIM_MODE | Input | Real | Similarity mode at sub-class level with default value as 0 for similarity values calculating for all items. |
| FUNC_FIT | Input | Boolean | Functional Fit Boolean at Sub-Class/ Product Attribute level. |
| VALID_ATTR | Input | Boolean | Product 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 Name | Parameter Type | Data Type | Description |
|---|---|---|---|
| OPT_ASSORT | Output | Boolean | Optimized Assortment after adding/ removing items based on input parameters at Item/Cluster level. |
| OPT_SALES | Output | Real | Optimized 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 Name | Parameter Type | Data Type | Description |
|---|---|---|---|
| DT_MASK | Input | Boolean | Mask at Sub-class/Cluster level for which Optimized Assortment needs to be calculated. |
| INIT_SALES | Input | Real | Initial 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_MAP | Input | Boolean | Same Item mapping across LHS-RHS Items at LHS-RHS Item level. |
| SIM_OUT | Input | Real | It 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_ITEM | Input | Boolean | New Items within the Assortment at Item/Cluster level. |
| INIT_ASSORT | Input | Boolean | Initial Planned Assortment before running Assortment Improvement at Item/Cluster level. |
| IMPROVE_METRIC | Input | Real | Metric 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_ITEM | Input | Boolean | All Eligible Items that can be included into the assortment for improvement at Item/Cluster level. |
| IMPROVE_COUNT | Input | Integer | Number of Items to be added, removed, or swapped from the assortment at Sub-Class/Cluster level. |
| MIN_TO_KEEP | Input | Real | Minimum Percentage of Initial Assortment to Keep during Assortment Improvement at Sub- Class/Cluster level. |
| OPT_MODE | Input | Integer | Optimization 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_ELASTICITY | Input | Real | Assortment Elasticity at Sub-Class/ Cluster level. |
| ITEM_MANDATORY | Input | Boolean | Mandatory Items to Keep after running Assortment Improvement at Item/Cluster level. |
| OPT_TARGET | Input | Real | Target to Achieve by Swapping assortments at Sub-Class/Cluster level. |
| PROD_ATTR | Input | String | Product Attribute values at Item/ Product Attribute level. |
| ATTR_WGT | Input | Real | Attribute 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 Name | Parameter Type | Data Type | Description |
|---|---|---|---|
| SIM_MODE | Input | Real | Similarity mode at sub-class level with default value as 0 for similarity values calculating for all items. |
| FUNC_FIT | Input | Boolean | Functional Fit Boolean at Sub-Class/ Product Attribute level. |
| VALID_ATTR | Input | Boolean | Product 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
- Guide: Assortment Planning Cloud Service Implementation Guide
- Previous: C Appendix: Standard Exports
- Next: POM