# Graph not displaying correctly when using quantile function

**URL:** <https://community.influxdata.com/t/graph-not-displaying-correctly-when-using-quantile-function/14447>\
**Category:** InfluxDB 2\
**Created:** [May 20, 2020, 5:41pm UTC](https://community.influxdata.com/t/graph-not-displaying-correctly-when-using-quantile-function/14447 "2020-05-20T17:41:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohsin106](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/mohsin106/32/4530_2.png) [@mohsin106](https://community.influxdata.com/u/mohsin106)\
**Post date:** [May 20, 2020, 5:41pm UTC](https://community.influxdata.com/t/graph-not-displaying-correctly-when-using-quantile-function/14447/1 "2020-05-20T17:41:36Z")

</div>

Hi,

I’m not able to get the graph to display correctly when I apply a quantile function in my query.

My query:

```
aeInBps = from(bucket: "bb_interfaces_test")
  |> range(start: -10m)
  |> filter(fn: (r) => r._measurement == "interfaces" and (r._field == "in-octets"))
  |> filter(fn: (r) => r.device =~ /chgo/)
  |> drop(columns:["path", "system_id"])
  |> group(columns: ["interface-name", "device"])
  |> aggregateWindow(every: 1m, fn: last)
  |> derivative(unit: 1m, nonNegative: true, columns: ["_value"])
  |> map(fn: (r) => ({ r with _value: float(v:r._value) / 60.0 * 8.0 }))
  // |> yield()
aeInBps
  |> quantile(q: .99, method: "exact_selector")
  |> yield()

```

If I remove the last 3 lines from the query (basically taking out the quantile part) then the graph prints out correctly.

Good output:

 ![image](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/c/c27ed70d2a9c817a06550a7e2b584e0075a720a9.png)

Bad output:

 ![image](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/e/e6994d8fe81c684afdb7bc2bf45c9edb71a6892e.png)

Thank you.

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [May 21, 2020, 4:18pm UTC](https://community.influxdata.com/t/graph-not-displaying-correctly-when-using-quantile-function/14447/2 "2020-05-21T16:18:10Z")

</div>

Hello @mohsin106,  
Can you please try using the estimate\_tdigest method instead? I believe you want the values that fall within the quantile? Not the value of the quantile?

When using the `estimate_tdigest` or `exact_mean` methods, it outputs non-null records with values that fall within the specified quantile.

When using the `exact_selector` method, it outputs the non-null record with the value that represents the specified quantile.
