# Value Calculation for Active Data

This topic describes how active data metrics are calculated. For additional information about what is used to calculate attribute values, sample data values, how often attributes are updated, and the periods for which they can be calculated, see Active Data Attributes.

## Value Calculation for Attributes with Null Values

Master product calculations ignore variations that have null or stale data when calculating the value of an attribute.

Sliced variation calculations ignore sliced variations that have null or stale data when calculating the value of an attribute.

Product sets ignore products in the set with null or stale data when calculating the value of an attribute. Null data isn't the same as a 0.0 value. If a 0.0 value is provided as current data, it's included in the calculation. See also Managing Stale Data.

For example, when calculating the cost price for a master product, if a master has five variants, but only four have data, then the sum of the four variants that have data is divided by four.

``````Master Product MP-1
Var-1: Cost Price = \$40.00
Var-2: Cost Price = \$40.00
Var-3: Cost Price = \$40.00
Var-4: Cost Price = \$0.00
Var-5:

Average online variants for MP-1 =
sum(CostPrice, variants) / count(variants)
(\$40.00 + \$40.00 \$40.00 + \$0.00) / 4 = \$30.00 ``````

## Active Data Attributes

Salesforce B2C Commerce calculates active data attributes that are not imported from other available attributes. The following table shows the calculation formulas.

Sorting Attribute Type Standard or Bundle Master Product Set Slicing Variation Group
AvailableDate Date

Active Data Value (user-provided)

Active Data Value (user-provided)

Active Data Value (user-provided)

Active Data Value from Master  (user-provided) Active Data Value (user-provided)
AvgGrossMarginPercent Double AvgGrossMarginValue / AvgSalesPrice * 100.0 AvgGrossMarginValue / AvgSalesPrice * 100.0

AvgGrossMarginValue / AvgSalesPrice * 100.0

Value from Master AvgGrossMarginValue / AvgSalesPrice * 100.0
AvgGrossMarginValue Double AvgSalesPrice - CostPrice AvgSalesPrice - CostPrice

AvgSalesPrice - CostPrice

Value from Master AvgSalesPrice - CostPrice
AvgSalesPrice Double Revenue / Units Average online variants sum(Revenue, variants) / sum(Units, variants)

sum(AvgSalesPrice, set_products)

Average all variants in slicing group

sum(Revenue, variants) / sum(Units, variants)

Average online variants sum(Revenue, variants) / sum(Units, variants)
Conversion Double Visits(site) / Orders(product)

Average online variants sum(Orders,variants) / (sum(Views,variants) + view(master))

(This is the same as LookToBookRatio.)

Average online set products sum(Conversion*Units, set_products) / sum (Units, set_products)

Average online variants in slicing group

sum(Conversion*Units, variants) / sum (Units, variants)

Average online variants sum(Orders,variants) / (sum(Views,variants) + view(variation group))

(This is the same as LookToBookRatio.)

CostPrice Double Active Data Value (user-provided) Average online variants sum(CostPrice, variants) / count(variants)

Sum of online set products sum(CostPrice, set_products)

Average online variants in slicing group

sum(CostPrice, variants) / count(variants)

Average online variants sum(CostPrice, variants) / count(variants)
CreationDate Date System data System data

System data

System data from Master  System data
DaysAvailable Double

(CurrentDate - AvailableDate) / 24h

or

(Current - CreationDate) / 24h

If there is no availableDate set, creationDate is used instead.

sum(DaysAvailable, variants + master)/count(variants + master)

CurrentDate - (AvailableDate) / 24h or Current - (CreationDate)/24h

Value from Master sum(DaysAvailable, variants + variation group)/count(variants + variation group)
Impressions Integer Impressions(product/bundle) Sum online variants + master value sum(Impressions, variants) + Impressions(master)

Impressions(product set)

Sum online variants in slicing group + master value

sum(Impressions, variants) + Impressions(master)

Sum online variants in variation group+ variation group value sum(Impressions, variants) + Impressions(variation group)
LastModified Date Product Value Product Value

Product Value

Value from Master Product Value
LookToBookRatio Double

Min(100, 100 * Orders/Views)

0 if Orders == 0

100 if Views == 0

Average online variants sum(Orders,variants) / (sum(Views,variants) + view(master))

Sum of online set products sum(LookToBookRatio*Units, set_products) / sum (Units, set_products)

Average online variants in slicing group

sum(LookToBookRatio, variants) / count(variants)

Average online variants sum(Orders,variants) / (sum(Views,variants) + view(variation group))
Orders Integer Orders(product/bundle) Sum all variants sum(Orders, variants)

Sum of online set products sum(Orders, set_products)

Sum all variants in slicing group

sum(Orders, variants)

Sum all variants in variation group sum(Orders, variants)
ReturnRate Double Active Data Value (user-provided) Average all variants sum(ReturnRate * UnitsYear, variant ) / sum(UnitsYear, variants)

Average all set products sum(ReturnRate * UnitsYear, set_products ) / sum(UnitsYear, set_products)

Average all variants in slicing group

sum(ReturnRate * UnitsYear, variant ) / sum(UnitsYear, variants)

Average all variants in variation group sum(ReturnRate * UnitsYear, variant ) / sum(UnitsYear, variants)
Revenue Double Revenue(product/bundle)

Sum all variants

sum(Revenue, variants)

Sum of online set products

sum(Revenue, set_products)

Sum all variants in slicing group

sum(Revenue, variants)

Sum all variants in variation group

sum(Revenue, variants)

SalesVelocity Double Units / (24.0 * min(1.0, DaysAvailable)) FeedImportDate + 24h - AvailabilityDate or CreationDate

Sum online variants

sum(SalesVelocity, variants)

Maximum online set products

max(SalesVelocity, set_products)

Sum online variants in slicing group

sum(SalesVelocity, variants)

Sum online variants in variation group

sum(SalesVelocity, variants)

Units Double Units(product/bundle)

Sum all variants

sum(Units, variants)

Sum of online set products

sum(Units, set_products)

Sum all variants in slicing group

sum(Units, variants)

Sum all variants in variation group

sum(Units, variants)

Views Integer Views(product/bundle)

Sum all variants + master value

sum(Views, variants) + Views(Master)

Views(product set)

Sum all variants in slicing group + master value

sum(Views, variants) + Views(Master)

Sum all variants + variation group value

sum(Views, variants) + Views(Variation Group)

## Sorting Attributes

The following attributes are used in sorting rules. This table describes how they are generally calculated for different product types.

Sorting Attribute Documentation Product Bundle Master Product Set Slicing Variation Group
String Attribute like name, description

Locale specific sorting of the string value. The locale of the index is used.

Null values are always last.

Product Value Product Value (Bundle)

Value of the master if it's defined.

Fallback to variations represented by search hit.

Value of the product set if it's defined.

Fallback to set products represented by search hit.

Value of the master if it's defined.

Fallback to variations at the group represented by search hit.

Value of the variation group if it's defined.

Fallback to variations represented by search hit.

Date attributes

Sorting of date values.

Null values are always last.

Product Value Product Value (Bundle)

Value of the master if it's defined.

Fallback to variations represented by search hit.

Value of the product set if it's defined.

Fallback to set products represented by search hit.

Value of the master if it's defined.

Fallback to variations at the group represented by search hit.

Value of the variation group if it's defined.

Fallback to variations represented by search hit.

Numeric attributes

Sorting of numeric values.

Null values are always last.

Product Value Product Value (Bundle)

Value of the master if it's defined.

Fallback to variations represented by search hit.

Value of the product set if it's defined.

Fallback to set products represented by search hit.

Value of the master if it's defined.

Fallback to variations at the group represented by search hit.

Value of the variation group if it's defined.

Fallback to variations represented by search hit.

Category-specific attributes (search rank and search placement)

Value of product in currently selected refinement category.

Null values are always last.

Product Value Product Value (Bundle)

Value of the master if it's defined.

Fallback to variations represented by search hit.

Value of the product set if it's defined.

Fallback to set products represented by search hit.

Value of the master if it's defined.

Fallback to variations at the group represented by search hit.

Value of the variation group if it's defined.

Fallback to variations represented by search hit.

## Special Sorting Attributes

These sorting rule attributes are calculated differently than most attributes.

Sorting Attribute Documentation Product Bundle Master ProductSet Slicing Variation Group
Availability Rank Creates two groups of search hits based on the attribute 'Availability' and a configurable threshold: "high availability" and "low or no availability". A search hit belongs to either the one or the other. Sorting direction is always descending and then group 'high availability' is shown before 'low availability'. Product Value Product Value (Bundle) Highest Availability of all variants represented by search hit. Highest Availability of all set products represented by search hit. Highest Availability of all variants at the group represented by search hit. Highest Availability of all variants represented by search hit.
Category Position Position of product in currently selected refinement category. Always ascending (highest positioned first). Product Value Product Value (Bundle) Product Value (Master) Product Value (Product Set) Master Value Product Value (VariationGroup)
Price The price book price currently active. Either ascending or descending. Product Value Product Value (Bundle) Lowest/highest price of all variants represented by search hit. Lowest/highest price of all set products represented by search hit. Lowest/highest price of all variants at the group represented by search hit. Lowest/highest price of all variants represented by search hit.
Text Relevance The relevance based on search keyword. Always descending (most relevant first). Product Value Product Value (Bundle) Most relevant variation represented by search hit. Most relevant set product represented by search hit. Most relevant variation at the group represented by search hit. Most relevant variation at the group represented by search hit.

## Product Attributes

These product attributes, used for active data, are listed by product type.
Sorting Attribute Type Product

Bundle

all bundled products

online bundled products

Master

all variations

online variations

Product Set

all set products

online set products

Slicing

all variations of group

online variations of group

Variation Group

all variations of group

online variations of group

ATS BigDecimal Product Value (Inventory Record)

Product Value (Bundle) if it's defined

Sum ATS of online bundled products (sum(ATS))

Product Value (Master) if it's defined

Sum ATS of online variations (sum(ATS))

Product Value (ProductSet) if it's defined

Sum ATS of online set products (sum(ATS))

Master Value if it's defined

Sum ATS of online variations the group (sum(ATS))

Product Value (VariationGroup) if it's defined

Sum ATS of online bundled products (sum(ATS))

Availability double Product Value (Inventory Record)

Product Value (Bundle) if it's defined and UseBundleInventoryOnly

Min Availability of bundle and all bundled products (min(Availability))

Product Value (Master) if it's defined

Average Availability of online variations (avg(Availability))

Product Value (ProductSet) if it's defined

Max Availability of online set products (max(Availability))

Master Value if it's defined

Average Availability of online variations at the group (avg(Availability))

Product Value (VariationGroup) if it's defined

Average Availability of online variations (avg(Availability))

Orderable boolean Product Value (Inventory Record)

Product Value (Bundle) if it's defined and UseBundleInventoryOnly

true in case all bundled products are orderable (no online check)

Product Value (Master) if it's defined

true in case one variation is orderable, false otherwise (no online check)

Product Value (Product Set) if it's defined

true in case one set product is orderable, false otherwise (no online check)

Master Value if it's defined

true in case one variation at the group is orderable, false otherwise (no online check)

Product Value (VariationGroup) if it's defined

true in case one variation is orderable, false otherwise (no online check)

SKUCoverage double Product Value (Inventory Record)

1 in case all online bundled products are in stock, 0 otherwise

Average SKUCoverage of online variations (avg(SKUCoverage))

The ratio of orderable SKUs in the product set over the total number of online SKUs in the product set.

1 in case one of the online variation at the group is in stock, 0 otherwise

Average SKUCoverage of online variations (avg(SKUCoverage))
TTOOS double Product Value (Inventory Record)

Product Value (Bundle) if it's defined

Min TTOOS of online bundled products (min(TTOOS))

Max TTOOS of online variations (max(TTOOS))

Max TTOOS of online set products (max(TTOOS))

Max TTOOS of online variations at the group (max(TTOOS))

Max TTOOS of online variations (max(TTOOS))
For more information and examples, see Availability, Cost Price, Days Available, SKU Coverage, and TTOOS,

## Value Calculation Example

This is an example of active data calculations.

Product Data ​​ Inventory Record Active Data Calculated (do not change)
SKU Color Size Online Allocation ATS Orders Views Units Availability SKU Coverage Sales Velocity TTOS
Variation group Red         n/a     5.00 1.00 0.96 120
1234A Red s 1 2 10 2 250 2 5.00 1 0.08 120
1234B Red m 1 2 10 8 0 8 5.00 1 0.33 30
1234C Red l 1 2 10 10 0 10 5.00 1 0.42 24
1234D Red xl 1 2 10 3 0 3 5.00 1 0.13 80
X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.