Using statistical operations

How to use statistical operations in Plytix formulas, with real examples of when you'd use each one

Statistical operations let you calculate summary values, like an average, minimum, or maximum, across a set of numbers. This article covers all three statistical operations, plus common use cases combining them.

AVERAGE

Finds the average of a numerical dataset.

Syntax:

AVERAGE(value1, [value2, ...])
  • value1: the first numerical value or range to consider.
  • value2, … (optional): additional numerical values or ranges to consider.

Compatible attribute types: Integer attributes, Decimal attributes.

Example:

AVERAGE(21, 35, 7)

Result: 21

MAX

Finds the maximum value in a numerical dataset.

Syntax:

MAX(value1, [value2, ...])
  • value1: the first value to consider.
  • value2, … (optional): additional values to consider.

Example:

MAX(4, 10, 99)

Result: 99

MIN

Finds the minimum value in a numerical dataset.

Syntax:

MIN(value1, [value2, ...])
  • value1: the first value to consider.
  • value2, … (optional): additional values to consider.

Example:

MIN(4, 10, 99)

Result: 4

Common Use Cases for Statistical Operations

Calculating an average rating or score across variants

If you track a numeric score (like a supplier rating, or an average customer review score entered manually) across several attributes or variants, AVERAGE gives you a single representative value without manual calculation:

AVERAGE($ATT.VARIANT_1_SCORE, $ATT.VARIANT_2_SCORE, $ATT.VARIANT_3_SCORE)

Displaying a "starting from" price across variants

If a parent product's variants have different prices, use MIN to automatically calculate the lowest price to display as a "starting from" price, without manually checking every variant:

MIN($ATT.VARIANT_1_PRICE, $ATT.VARIANT_2_PRICE, $ATT.VARIANT_3_PRICE)

Highlighting your most expensive variant or bundle option

Similarly, MAX can automatically surface the highest price point across a set of options, useful for showing a price range (combined with MIN) or flagging your premium option:

MAX($ATT.VARIANT_1_PRICE, $ATT.VARIANT_2_PRICE, $ATT.VARIANT_3_PRICE)

These are often combined with each other, for example, showing both MIN and MAX together to display a full price range across a product’s variants.

Frequently Asked Questions

The AVERAGE function works with Integer and Decimal attributes.

Yes. This is a common pattern: MIN retrieves the lowest value in a set, while MAX retrieves the highest. You can combine them to output a formatted range (e.g., “$10 – $50”).