SUM_PRODUCT

Description

SUM_PRODUCT multiplies the values in one list with values that are on the same index in another list.

It then adds up those multiplications, resulting in a single new value.

Example

This operator can be useful if you want to give some values in a calculation a different weight than others.

Say the overall risk factor of a client is a number calculated from five individual risk factor numbers.

Each individual risk factor is given a certain weight in the overall calculation, depending on how impactful we think that factor is.

For example:

Risk Factors

Weight

risk_factor_1

4

risk_factor_2

2

risk_factor_3

5

risk_factor_4

1

risk_factor_5

3

To calculate the overall risk score using SUM_PRODUCT, each individual risk factor score will be multiplied by its weight. The results are then summed up and returned as a single value.

For the table above, if the respective risk_factor values are 3, 6, 2, 8, and 5, the returned result would be 57.

SUM_PRODUCT