Endeca Derived properties to get Min and Max price for Sale/Clearance/List/MSRP prices - Endeca Features

A derived property is a property that is calculated by applying a function to properties or Dimension values from each member record of an aggregated record. Derived properties are created by Forge, based on the configuration settings in the Derived_props.xml file. After a derived property is created, the resultant derived property is assigned to the aggregated record.

Problem Statement:
Consider one product with 5 SKU's and each SKU has sale,List,clearance and MSRP price tagged and requirement is to traverse through all the prices tagged on SKU's and get the MIN and MAX for sale, Clearance, List  and MSRP.


Solution:
1) Change Derived_props.xml file in pipeline

/opt/app/endeca/apps/CRS/config/pipeline/Derived_props.xml
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <!DOCTYPE DERIVED_PROPS SYSTEM "derived_props.dtd"> <DERIVED_PROPS>
  <DERIVED_PROP DERIVE_FROM="sku.listPrice" FCN="MAX" NAME="P_SKU_ListPrice_Max"/>
  <DERIVED_PROP DERIVE_FROM="sku.listPrice" FCN="MIN" NAME="P_SKU_ListPrice_Min"/>
  <DERIVED_PROP DERIVE_FROM="sku.salePrice" FCN="MAX" NAME="P_SKU_SalePrice_Max"/>
  <DERIVED_PROP DERIVE_FROM="sku.salePrice" FCN="MIN" NAME="P_SKU_SalePrice_Min"/>
  <DERIVED_PROP DERIVE_FROM="sku.MSRP" FCN="MAX" NAME="P_SKU_MSRP_Max"/>
  <DERIVED_PROP DERIVE_FROM="sku.MSRP" FCN="MIN" NAME="P_SKU_MSRP_Min"/>
  <DERIVED_PROP DERIVE_FROM="sku.clearencePrice" FCN="MAX" NAME="P_SKU_ClearencePrice_Max"/>
  <DERIVED_PROP DERIVE_FROM="sku.clearencePrice" FCN="MIN" NAME="P_SKU_ClearencePrice_Min"/>
</DERIVED_PROPS>

2) Run baseline index
3) Check reference application for Derived properties
Endeca reference Application:

8056678  (5 Records)
DERIVED PROPERTIES:
P_SKU_ListPrice_Max:  39.990000
P_SKU_ListPrice_Min:  38.990000
P_SKU_SalePrice_Max:  39.990000
P_SKU_SalePrice_Min:  38.990000
P_SKU_MSRP_Max:  55.000000
P_SKU_MSRP_Min:  54.000000
P_SKU_ClearencePrice_Max: 
P_SKU_ClearencePrice_Min: 
REPRESENTATIVE REC PROPERTIES:
allAncestors.repositoryId:  cat130021
allAncestors.repositoryId:  cat130052
allAncestors.repositoryId:  cat130155
allAncestors.repositoryId:  rootCategory
FYI - Derived properties can be only created on Aggregated records.
Valid functions are MIN, MAX, AVG, or SUM

4 comments:

  1. Hi,

    Can you filter records based on derived properties? thanks

    ReplyDelete
    Replies
    1. I have not tried it but you can do as below:

      1) Create New property in Endeca pipeline and enable it as filterable
      2) Map derived property to new property
      3) Index and test it with Nrf filter

      Regards,
      Ravi

      Delete
  2. This comment has been removed by the author.

    ReplyDelete