Attribute Based Engine
The idea of attribute-based pricing is to define the price based on product attributes like color, weight etc. It is based on the Anchor → Follower approach: take the price of another SKU, then modify it to get the final price.
The engine supports only one level which means there can only be pairs like SKU A → SKU B. A chain of anchors like SKU A → SKU B → SKU C → … is not supported.
Note: If the used Price List or Live Price Grid is of the Matrix type, the engine assumes that the second key is used for storing the volume information and will search for an anchor product with the secondary key equaling to 1.
In this section:
Understanding the Calculation Mechanism
The formula is defined in the AttributeBasedPricingRules PP. It takes the price of the anchor SKU as the basis, then calculates from left to right; there are no additional math operations. For each attribute in the rule:
It gets the current product attribute value. The way to find it is defined in the PricingAttributes PP.
It gets the impact of the above value. The impact value can be Value-Based or Interval-Based. It is defined in the ValueAttributesConversion PP or IntervalAttributesConversion PP accordingly.
It calculates with the impact value.
Warnings
A rule is considered to be invalid if it is not a continuous string or it is a continuous string but ends with an operator. Example:
Divide by zero is not allowed.
If it is configured to have validity periods and the data overlap, an exception is thrown.
If it is configured to have dependency mapping but no data match the criteria, it gets the first one with the null value in the filter field.
Any invalid field name / rule name / attribute name / … is not allowed.
This engine uses the re-run (“marked as dirty”) functionality of Pricefx. You should not mix products that are used by other engines that mark items as dirty (e.g. Kit Engine) in one PL/LPG. It can lead to undefined behavior and wrong results.
This engine only works correctly when all related products are in the current calculated Price List or Live Price Grid.
How to Use It
Input Parameters
Input | Type | Description |
---|---|---|
SKU | String | SKU of the calculated product. |
Final List Price Element Name | String | Name of the element that keeps the Final List Price. It will be used for the Anchor price lookup if the calculation is in the Net mode. |
Final Price Element Name | String | Name of the element that has the Final Price. It will be used for Anchor price lookup if the Final List Price element is empty. It usually happens during the Gross calculation. |
Dependency Properties | String | Properties of current dependency. |
Strategy Name | String | Name of the strategy. It is used to connect the name of the attribute based strategy (in PP AttributeBasedPricingRules). You can use the constant |
Additional Engine Configuration
This engine needs an additional simple configuration Price Parameter where all Configuration Options are present as keys.
Configuration Option | Expected Value | Description |
---|---|---|
Source Type | Allowed values:
| Defines where the anchor data is kept. |
Source Name | ExampleTableName | Name of the data table. Expected only when PX or PP Source Type is used. |
Anchor Field Name | ExampleAnchorColumn | Name of the column that contains SKU of the anchor product. |
Sku Field Label | ExampleSkuColumn | Name of the column that contains SKU of a currently calculated product. |
Default Strategy Calculation Parameters
SKU,FINAL_LIST_PRICE_ELEMENT_NAME,FINAL_PRICE_ELEMENT_NAME,DEPENDENCY_PROPERTIES,STRATEGY_NAME
Define Attribute Data (with Sample Data)
AttributeBasedPricingRules PP
Name | Operator #1 | Pricing Attribute #1 | Operator #… | Pricing Attribute #… |
---|---|---|---|---|
Attribute-Based Simple | + | Color | + | Size |
… | … | … | / | 0 |
Fields:
Name – Rule name
Operator #XX – Supported operators: +, -, *, /
Attribute #XX – Existing pricing attribute name in PricingAttributes PP
PricingAttributes PP
Pricing Attribute (Key) | Type | Source Type | Source Name | Source Field | Dependency Field | Dependency Mapping Type | Mapping Source Field | ValidFrom Field Name | ValidTo Field Name |
---|---|---|---|---|---|---|---|---|---|
Color | Value | P |
| Color |
|
|
|
|
|
Size | Interval | PX | Additional Product Data | Size | Country | Lookup | Country | ValidFrom | ValidTo |
Weight | Direct Value | P |
| Weight |
|
|
|
|
|
Fields:
Pricing Attribute – Name of the attribute
Type – Attribute value type
Value – Single value
Interval – Value in a specified range
Direct Value – Impact value is also the attribute value, no conversion for this type. The value data type can only be a number.
Direct Value and Interval Type only works for numeric values.
Source Type – Source table type
P / PX / PP
Source Name – Name of the source table
Source Field – Name of the field in the source table to take attribute value
Dependency Field – Name of the field in the dependency configuration table to take dependency value
Dependency Mapping Type – Type of dependency mapping
Lookup / Table
Fallback on dependency mapping – Returns one with “null” in the dependency field when there is no specific one
Mapping Source Field – Name of the field in the source table to take the matching value
Valid From Field Name – Name of the field in the source table to take the beginning date of the validity period
Valid To Field Name – Name of the field in the source table to take the end date of the validity period
ValueAttributesConversion PP
Pricing Attribute | Pricing Attribute Value | Price Impact Value |
---|---|---|
Color | red | 3 |
Color | blue | 2 |
Color | 2 | 1 |
Color | <<fallback>> | 1.5 |
Mapping one attribute value to one impact value. The attribute value can be both string and number.
IntervalAttributesConversion PP
Pricing Attribute | Pricing Attribute Value From | Pricing Attribute Value To (including) | Price Impact Value |
---|---|---|---|
Size | 0 | 10 | 1.2 |
Size | 10 | 50 | 1.4 |
Size | 50 | 999999999 | 1.5 |
Mapping many attributes value to one impact value. The attribute value can only be number.