# Flux remove spikes - quantile() access to its \_value

**URL:** <https://community.influxdata.com/t/flux-remove-spikes-quantile-access-to-its-value/18236>\
**Category:** Fluxlang\
**Created:** [February 8, 2021, 5:39pm UTC](https://community.influxdata.com/t/flux-remove-spikes-quantile-access-to-its-value/18236 "2021-02-08T17:39:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dohny](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/dohny/32/6583_2.png) [@dohny](https://community.influxdata.com/u/dohny)\
**Post date:** [February 8, 2021, 5:39pm UTC](https://community.influxdata.com/t/flux-remove-spikes-quantile-access-to-its-value/18236/1 "2021-02-08T17:39:46Z")

</div>

I’m writing filter to remove spikes in our datasets (for visualization). Is possible to write this in flux? Comparing based on quantile, that is computed from dataset and applied in filter.

```auto
data = from(bucket: "meteo")
  |> range(start: v.timeRangeStart, stop:v.timeRangeStop)
  |> filter(fn: (r) =>
    r._measurement == "BREB" and
    r._field == "TA_1_1_1" and
    r.location == "RUT"
  )
  |> aggregateWindow(
       every: 10m,
       fn: mean)
       
quantUp = data
  |> quantile(
    q: 0.95,
    method: "exact_mean"
  )

quantLo = data
  |> quantile(
    q: 0.05,
    method: "exact_mean"
  )

```

_**here is problem (first row):**_

```auto
 range_q = quantUp-quantLo 
 range_q_abs = math.abs(x:range_q)
 low = quantLo - range_q_abs * 0.1
 up = quantUp + range_q_abs * 0.1

```

and apply filter…

```auto
data
  |> filter(fn: (r) =>
    r._value < up and
    r._value > low
  )

```

Flux always returning comparision or type error quantUp/quantLo

```auto
- expected float but found [A] or
- expected {A with _value:B} but found [C]

```

How to access to quantile float \_value?
