﻿---
title: ES|QL MV_PSERIES_WEIGHTED_SUM function
description: 
url: https://www.elastic.co/elastic/docs-builder/docs/2987/reference/query-languages/esql/functions-operators/mv-functions/mv_pseries_weighted_sum
products:
  - Elasticsearch
---

# ES|QL MV_PSERIES_WEIGHTED_SUM function
## Syntax

![Embedded](https://www.elastic.co/elastic/docs-builder/docs/2987/reference/query-languages/esql/images/functions/mv_pseries_weighted_sum.svg)


## Parameters

<definitions>
  <definition term="number">
    Expression that can be null, a single value, or multiple values.
  </definition>
  <definition term="p">
    It is a constant number that represents the *p* parameter in the P-Series. It impacts every element’s contribution to the weighted sum.
  </definition>
</definitions>


## Description

Converts a multivalued expression into a single-valued column by multiplying every element on the input list by its corresponding term in P-Series and computing the sum.

## Supported types


| number | p      | result |
|--------|--------|--------|
| double | double | double |


## Example

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


| sum:double        |
|-------------------|
| 94.45465156212452 |