# How to exclude numeric value from a pie chart?

**URL:** <https://discuss.elastic.co/t/how-to-exclude-numeric-value-from-a-pie-chart/81458>\
**Category:** Kibana\
**Created:** [April 6, 2017, 12:07pm UTC](https://discuss.elastic.co/t/how-to-exclude-numeric-value-from-a-pie-chart/81458 "2017-04-06T12:07:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pmbanka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pmbanka/32/17121_2.png) [@pmbanka](https://discuss.elastic.co/u/pmbanka)\
**Post date:** [April 6, 2017, 12:07pm UTC](https://discuss.elastic.co/t/how-to-exclude-numeric-value-from-a-pie-chart/81458/1 "2017-04-06T12:07:36Z")

</div>

I'm trying to set up a piechart displaying data from a number-type field. In advanced option there is an "Exclude" field which I want to use, but I can't find a way to get it to work. Whatever I type in (I want to exclude value `0`, so I tried `0`, `[0]`, `"0"`, `["0"]` etc.) I get the error:

```auto
Error: Request to Elasticsearch failed: {"error":{"root_cause":[{"type":"aggregation_execution_exception","reason":"Aggregation [2] cannot support regular expression style include/exclude settings as they can only be applied to string fields. Use an array of numeric values for include/exclude clauses used to filter numeric fields"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"prod-oddjob-persistence","node":"0C8MFw1eSDecV96BRXi49A","reason":{"type":"aggregation_execution_exception","reason":"Aggregation [2] cannot support regular expression style include/exclude settings as they can only be applied to string fields. Use an array of numeric values for include/exclude clauses used to filter numeric fields"}}],"caused_by":{"type":"aggregation_execution_exception","reason":"Aggregation [2] cannot support regular expression style include/exclude settings as they can only be applied to string fields. Use an array of numeric values for include/exclude clauses used to filter numeric fields"}},"status":500}

```

It seems like it should be doable (`Use an array of numeric values for include/exclude clauses used to filter numeric fields`), but it does not seem to accept my input. Is this a bug or a not implemented feature?

I'm using Kibana 5.3.0.

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [April 6, 2017, 7:49pm UTC](https://discuss.elastic.co/t/how-to-exclude-numeric-value-from-a-pie-chart/81458/2 "2017-04-06T19:49:10Z")

</div>

In the aggregation, `exclude` is a way to [filter values](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#_filtering_values_2) in the terms agg. More correctly, it's a way to filter buckets/aggregations, but not their metric.

The problem is, 0 isn't an aggregation, it's a metric. That is, it's a count, or sum, or average, etc. Kibana doesn't allow you to filter metrics, so what you're trying to do isn't possible. You could do what you want using the [bucket\_selector](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-bucket-selector-aggregation.html) aggregation, but Kibana doesn't have support for that.

---

<div class="post-metadata">

**Author:** ![pmbanka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pmbanka/32/17121_2.png) [@pmbanka](https://discuss.elastic.co/u/pmbanka)\
**Post date:** [April 7, 2017, 7:22am UTC](https://discuss.elastic.co/t/how-to-exclude-numeric-value-from-a-pie-chart/81458/3 "2017-04-07T07:22:01Z")

</div>

Thanks for the explanation.

For future visitors - the workaround for my use case was having a pie chart use a predefined search in which I explicitly exclude `0` value.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 5, 2017, 7:31am UTC](https://discuss.elastic.co/t/how-to-exclude-numeric-value-from-a-pie-chart/81458/4 "2017-05-05T07:31:31Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
