Weighted Average

logic · C320 · starter-package 7.0.1

Purpose

Calculate an average where each value has an explicit influence.

Connectors

  • Values: non-empty list of finite numbers.
  • Weights: equally sized list of finite, non-negative numbers.
  • Result: weighted-average number.

Example

Values [10, 20] with weights [1, 3] return 17.5.

Failure cases

Lists longer than 4096, unequal lengths, negative weights, a zero total weight, invalid numbers, or overflowing products stop execution.

Errors and recovery

When this block reports an error, no downstream output is emitted. Correct the highlighted input or setting described by the message, then run the workflow again.

Connector data types

The type below is the data type that actually travels through the connection. Any additional validation is described separately in this block guide.

DirectionConnectorTypeRequired
Inputvalues — Valueslistyes
Inputweights — Weightslistyes
Outputresult — Resultnumberon success