# Count and visualize field cardinality greater than a given number

**URL:** <https://discuss.elastic.co/t/count-and-visualize-field-cardinality-greater-than-a-given-number/174171>\
**Category:** Elasticsearch\
**Created:** [March 27, 2019, 4:15pm UTC](https://discuss.elastic.co/t/count-and-visualize-field-cardinality-greater-than-a-given-number/174171 "2019-03-27T16:15:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elk\_user188](https://avatars.discourse-cdn.com/v4/letter/e/da6949/32.png) [@elk\_user188](https://discuss.elastic.co/u/elk_user188)\
**Post date:** [March 27, 2019, 4:15pm UTC](https://discuss.elastic.co/t/count-and-visualize-field-cardinality-greater-than-a-given-number/174171/1 "2019-03-27T16:15:11Z")

</div>

Hi there!

Here's my question:

let's say I have some documents with two fields FIELD\_1 and FIELD\_2. It might occur that for a certain FIELD\_1, there are more than one FIELD\_2 associated,  
so that some entries might be like:

FIELD\_1: XYZ e FIELD\_2: 123  
FIELD\_1: XYZ e FIELD\_2: 456

Now, I'd like to have (and visualize) the cardinality of those entries which have more than one FIELD\_2 associated.  
It means that for a list like:

FIELD\_1: XYZ e FIELD\_2: 123  
FIELD\_1: XYZ e FIELD\_2: 456  
FIELD\_1: ABC e FIELD\_2: 629  
FIELD\_1: DEF e FIELD\_2: 789  
FIELD\_1: DEF e FIELD\_2: 341

The visualization should return 2, because only the docs whose FIELD\_1 is either XYZ or DEF have more than one FIELD\_2 associated.

Can you help me?

---

<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:** [April 24, 2019, 4:15pm UTC](https://discuss.elastic.co/t/count-and-visualize-field-cardinality-greater-than-a-given-number/174171/2 "2019-04-24T16:15:12Z")

</div>

Closed on April 24, 2019, 4:15pm UTC

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