# How to apply filter for one field,

**URL:** https://discuss.elastic.co/t/how-to-apply-filter-for-one-field/236348
**Category:** Kibana
**Created:** [June 9, 2020, 1:36pm UTC](https://discuss.elastic.co/t/how-to-apply-filter-for-one-field/236348 "2020-06-09T13:36:27Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![inchirah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inchirah/32/48145_2.png) [@inchirah](https://discuss.elastic.co/u/inchirah)
#### Post date: [June 9, 2020, 1:36pm UTC](https://discuss.elastic.co/t/how-to-apply-filter-for-one-field/236348/1 "2020-06-09T13:36:28Z")

</div>

Hello,

I tried to apply filter for the second field "Attempt Compliant" but each time its applied for the two fields.

 ![104060026_736246177124242_3379422342015150788_n](https://us1.discourse-cdn.com/elastic/original/3X/f/0/f03b9e29a77cef4cff3c03afac98a8b44fb6b834.png)  
 ![103410719_2668939803391291_591415223063418328_n](https://us1.discourse-cdn.com/elastic/original/3X/2/4/241a1b9d66c27f5eb8e8d2dc70c81fdaa742038f.png)

Could anyone help me please?

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [June 9, 2020, 1:42pm UTC](https://discuss.elastic.co/t/how-to-apply-filter-for-one-field/236348/2 "2020-06-09T13:42:55Z")

</div>

Currently it's not possible in Lens to have a "filtered metric" like you are describing.  
However this sounds like a great extension, feel free to create an issue for it in the Kibana repo: [https://github.com/elastic/kibana/issues/new?template=Feature\_request.md](https://github.com/elastic/kibana/issues/new?template=Feature_request.md)

As a workaround, you can create two separate visualizations (one with query and one without), save them both and put them on a dashboard next to each other. The current query is saved along with the visualization.

---

<div class="post-metadata">

### Author: ![inchirah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inchirah/32/48145_2.png) [@inchirah](https://discuss.elastic.co/u/inchirah)
#### Post date: [June 9, 2020, 2:48pm UTC](https://discuss.elastic.co/t/how-to-apply-filter-for-one-field/236348/3 "2020-06-09T14:48:34Z")

</div>

Hi,  
Thank you for your answer.  
I tried to do the same operation but without lens and I get the some result.  
Its so important to me to show the table using those two diferent fields, specially I will use them both to calculate a new field.

 ![2222](https://us1.discourse-cdn.com/elastic/original/3X/7/4/742df7d1dc71da21a45796706e58429254742f9e.png)

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [June 9, 2020, 4:14pm UTC](https://discuss.elastic.co/t/how-to-apply-filter-for-one-field/236348/4 "2020-06-09T16:14:08Z")

</div>

You can't create calculated fields based on table columns (neither with Lens nor with the regular table). If you want to do something like this, I suggest looking into vega. If you describe what exactly you want to do I can help figuring out how to implement it there.

---

<div class="post-metadata">

### Author: ![inchirah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inchirah/32/48145_2.png) [@inchirah](https://discuss.elastic.co/u/inchirah)
#### Post date: [June 9, 2020, 9:36pm UTC](https://discuss.elastic.co/t/how-to-apply-filter-for-one-field/236348/5 "2020-06-09T21:36:47Z")

</div>

Hi  
thanks for your offering help.  
Actually this is a capture from my data set.  
 ![2g](https://us1.discourse-cdn.com/elastic/original/3X/c/6/c6805f22faeef42487dcb618072e15b031089110.png)

I want, using kibana, to create a data table include the next fields.  
**Attempt number** (unique count if id), it's simply the number of observations  
**Attempt Compliant** , wich is the number of observations that obey a certain condition  
And finally **Percentage** wich is the ratio of **Attempt Number** out of **Attempt Compliant**  
I really have to use kibana to get this result, it's part of my end of studies project.  
Could you please help me?

Thank you.

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [June 10, 2020, 6:52pm UTC](https://discuss.elastic.co/t/how-to-apply-filter-for-one-field/236348/6 "2020-06-10T18:52:59Z")

</div>

Actually I think there is a better way than vega - you should be able to do this with TSVB and the “filter ratio” aggregation

---

<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: [July 8, 2020, 6:53pm UTC](https://discuss.elastic.co/t/how-to-apply-filter-for-one-field/236348/7 "2020-07-08T18:53:18Z")

</div>

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