# Cardinality of 1 vs. 0

**URL:** <https://discuss.elastic.co/t/cardinality-of-1-vs-0/287010>\
**Category:** Elasticsearch\
**Created:** [October 18, 2021, 3:03pm UTC](https://discuss.elastic.co/t/cardinality-of-1-vs-0/287010 "2021-10-18T15:03:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wolfhoundjesse](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfhoundjesse/32/96042_2.png) [@wolfhoundjesse](https://discuss.elastic.co/u/wolfhoundjesse)\
**Post date:** [October 18, 2021, 3:03pm UTC](https://discuss.elastic.co/t/cardinality-of-1-vs-0/287010/1 "2021-10-18T15:03:25Z")

</div>

I'm curious, if cardinality returns the count of distinct values, what does 0 mean? If there are two distinct values, you get 2. If they're all the same, you get 1. My best guess is that a zero means there was nothing to compare it to, e.g., if you did cardinality on a single row.

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [October 18, 2021, 3:17pm UTC](https://discuss.elastic.co/t/cardinality-of-1-vs-0/287010/2 "2021-10-18T15:17:51Z")

</div>

Hi Jesse.  
It would likely mean you matched no docs or the docs didn't have any values for the field in question

---

<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:** [November 15, 2021, 3:18pm UTC](https://discuss.elastic.co/t/cardinality-of-1-vs-0/287010/3 "2021-11-15T15:18:45Z")

</div>

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