# MV_PSERIES_WEIGHTED_SUM

The MV_PSERIES_WEIGHTED_SUM function transforms a multivalued expression into a single-valued column by multiplying each element in the input list by its corresponding term in a P-Series and then summing the results.

## Syntax

`MV_PSERIES_WEIGHTED_SUM(number, p)`

### Parameters

#### number

The multivalue expression to be processed.

#### p

A constant number representing the *p* parameter in the P-Series, which affects each element’s contribution to the weighted sum.

## Examples

Calculates the weighted sum of the list `[70.0, 45.0, 21.0, 21.0, 21.0]` using a P-Series with p set to 1.5 and returns the result in the `sum` column.

```esql
ROW a = [70.0, 45.0, 21.0, 21.0, 21.0]
| EVAL sum = MV_PSERIES_WEIGHTED_SUM(a, 1.5)
| KEEP sum
```
