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.

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:<MEAS>,BOP:<MEAS> <- BopEopCalcExpr(TODAYINDEX:<MEAS>, INCEOP:<MEAS>, ACTEOP:<MEAS>, TSMASK:<MEAS>, INITIALBOP:<MEAS>)

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.

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: <MEAS>, POINTMEMBERSHIPSTR: <MEAS>, CENTROID: <MEAS> <- ClusterExpr(MEASURE: <MEAS>, METHOD: <STRING>, NUMCLUSTERS: <MEAS>, CLUSTERHIER: <HIER>, BYGROUPDIMS: <DIMENSION>)

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.

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 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.

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.

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.

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.