# How to give WHERE condition in data table

**URL:** <https://discuss.elastic.co/t/how-to-give-where-condition-in-data-table/132286>\
**Category:** Kibana\
**Created:** [May 17, 2018, 9:06am UTC](https://discuss.elastic.co/t/how-to-give-where-condition-in-data-table/132286 "2018-05-17T09:06:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikas.joinme](https://avatars.discourse-cdn.com/v4/letter/v/4491bb/32.png) [@vikas.joinme](https://discuss.elastic.co/u/vikas.joinme)\
**Post date:** [May 17, 2018, 9:06am UTC](https://discuss.elastic.co/t/how-to-give-where-condition-in-data-table/132286/1 "2018-05-17T09:06:25Z")

</div>

I've a data table with count as one of the columns. How do i set a condition on the column to display rows of data only if count \> 50.

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [May 17, 2018, 6:06pm UTC](https://discuss.elastic.co/t/how-to-give-where-condition-in-data-table/132286/2 "2018-05-17T18:06:52Z")

</div>

You can use a scripted field here:  
[https://www.elastic.co/guide/en/kibana/current/scripted-fields.html](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html)

Create a scripted field which will set to the value of count when its \>50 and then display that in your aggs.

Thanks,  
Bhavya

---

<div class="post-metadata">

**Author:** ![vikas.joinme](https://avatars.discourse-cdn.com/v4/letter/v/4491bb/32.png) [@vikas.joinme](https://discuss.elastic.co/u/vikas.joinme)\
**Post date:** [May 18, 2018, 3:27am UTC](https://discuss.elastic.co/t/how-to-give-where-condition-in-data-table/132286/3 "2018-05-18T03:27:48Z")

</div>

Okay great thanks Bhavya.  
could you give one example for scripted fields,if possible

---

<div class="post-metadata">

**Author:** ![vikas.joinme](https://avatars.discourse-cdn.com/v4/letter/v/4491bb/32.png) [@vikas.joinme](https://discuss.elastic.co/u/vikas.joinme)\
**Post date:** [May 18, 2018, 9:27am UTC](https://discuss.elastic.co/t/how-to-give-where-condition-in-data-table/132286/4 "2018-05-18T09:27:22Z")

</div>

suppose i want to select the only those rows which have color blue

---

<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:** [June 15, 2018, 9:27am UTC](https://discuss.elastic.co/t/how-to-give-where-condition-in-data-table/132286/5 "2018-06-15T09:27:35Z")

</div>

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