---
title: experimental.spread() function
description: experimental.spread() returns the difference between the minimum and maximum values in the _value column for each input table.
url: https://docs.influxdata.com/flux/v0/stdlib/experimental/spread/
estimated_tokens: 637
product: Flux
version: v0
publisher: InfluxData
canonical: https://docs.influxdata.com/flux/v0/stdlib/experimental/spread/
date: '2024-04-08T16:01:02-06:00'
lastmod: '2024-04-08T16:01:02-06:00'
---

* Flux 0.107.0+

InfluxDB support

> [!Important]
> `experimental.spread()` is [subject to change at any time](/flux/v0/stdlib/experimental/#experimental-packages-are-subject-to-change).

`experimental.spread()` returns the difference between the minimum and maximum values in the`_value` column for each input table.

##### Function type signature

```js
(<-tables: stream[{A with _value: B}]) => stream[{A with _value: B}] where B: Numeric
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### tables

Input data. Default is piped-forward data (`<-`).

## Examples

### Return the difference between minimum and maximum values

```js
import "experimental"
import "sampledata"

sampledata.float()
    |> experimental.spread()
```

[](#view-example-input-and-output)

View example input and output

#### Input data

|       \_time       |\*tag|\_value|
|--------------------|-----|-------|
|2021-01-01T00:00:00Z| t1  |\-2.18 |
|2021-01-01T00:00:10Z| t1  | 10.92 |
|2021-01-01T00:00:20Z| t1  | 7.35  |
|2021-01-01T00:00:30Z| t1  | 17.53 |
|2021-01-01T00:00:40Z| t1  | 15.23 |
|2021-01-01T00:00:50Z| t1  | 4.43  |

|       \_time       |\*tag|\_value|
|--------------------|-----|-------|
|2021-01-01T00:00:00Z| t2  | 19.85 |
|2021-01-01T00:00:10Z| t2  | 4.97  |
|2021-01-01T00:00:20Z| t2  |\-3.75 |
|2021-01-01T00:00:30Z| t2  | 19.77 |
|2021-01-01T00:00:40Z| t2  | 13.86 |
|2021-01-01T00:00:50Z| t2  | 1.86  |

#### Output data

|\*tag|\_value|
|-----|-------|
| t1  | 19.71 |

|\*tag|\_value|
|-----|-------|
| t2  | 23.6  |

#### Related

* [spread() function](/flux/v0/stdlib/universe/spread/)
* [InfluxQL – SPREAD()](/influxdb/v1/query_language/functions/#spread)

[transformations](/flux/v0/tags/transformations/)[aggregates](/flux/v0/tags/aggregates/)
| _time | *tag | _value |
| --- | --- | --- |
| _time | *tag | _value |
| 2021-01-01T00:00:00Z | t1 | -2.18 |
| 2021-01-01T00:00:10Z | t1 | 10.92 |
| 2021-01-01T00:00:20Z | t1 | 7.35 |
| 2021-01-01T00:00:30Z | t1 | 17.53 |
| 2021-01-01T00:00:40Z | t1 | 15.23 |
| 2021-01-01T00:00:50Z | t1 | 4.43 |

| _time | *tag | _value |
| --- | --- | --- |
| _time | *tag | _value |
| 2021-01-01T00:00:00Z | t2 | 19.85 |
| 2021-01-01T00:00:10Z | t2 | 4.97 |
| 2021-01-01T00:00:20Z | t2 | -3.75 |
| 2021-01-01T00:00:30Z | t2 | 19.77 |
| 2021-01-01T00:00:40Z | t2 | 13.86 |
| 2021-01-01T00:00:50Z | t2 | 1.86 |

| *tag | _value |
| --- | --- |
| *tag | _value |
| t1 | 19.71 |

| *tag | _value |
| --- | --- |
| *tag | _value |
| t2 | 23.6 |
