# How can i exclude 0 from an uniqe count?

**URL:** <https://discuss.elastic.co/t/how-can-i-exclude-0-from-an-uniqe-count/320471>\
**Category:** Elasticsearch\
**Created:** [December 5, 2022, 1:44pm UTC](https://discuss.elastic.co/t/how-can-i-exclude-0-from-an-uniqe-count/320471 "2022-12-05T13:44:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jakomo04](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jakomo04/32/114226_2.png) [@Jakomo04](https://discuss.elastic.co/u/Jakomo04)\
**Post date:** [December 5, 2022, 1:44pm UTC](https://discuss.elastic.co/t/how-can-i-exclude-0-from-an-uniqe-count/320471/1 "2022-12-05T13:44:09Z")

</div>

Hi,  
I have to do a Visualization that only shows the data over 10 of an unique count i tried "clamp(unique\_count('info.job-id.keyword') - 10, 0, 1) \* unique\_count('info.job-id.keyword')" . Now i have all the data under 10 with a zero and the data above shows the normal unique count value the Problem is i need to exclude all values with 0 so that the Visualization only shows the values over ten.  
Does anyone have an Idea to solve this Problem?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 5, 2022, 4:46pm UTC](https://discuss.elastic.co/t/how-can-i-exclude-0-from-an-uniqe-count/320471/2 "2022-12-05T16:46:48Z")

</div>

Assuming this is lens you can just put a KQL query in the KQL query bar something like

`not info.job-id.keyword: 0`

Which will exclude all document with `info.job-id.keyword: 0`  
Perhaps I am not understanding.

---

<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:** [January 2, 2023, 4:47pm UTC](https://discuss.elastic.co/t/how-can-i-exclude-0-from-an-uniqe-count/320471/3 "2023-01-02T16:47:09Z")

</div>

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