# Count the number of text type records

**URL:** <https://discuss.elastic.co/t/count-the-number-of-text-type-records/205883>\
**Category:** Kibana\
**Created:** [October 30, 2019, 2:42pm UTC](https://discuss.elastic.co/t/count-the-number-of-text-type-records/205883 "2019-10-30T14:42:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andres\_cvilla](https://avatars.discourse-cdn.com/v4/letter/a/c77e96/32.png) [@andres\_cvilla](https://discuss.elastic.co/u/andres_cvilla)\
**Post date:** [October 30, 2019, 2:42pm UTC](https://discuss.elastic.co/t/count-the-number-of-text-type-records/205883/1 "2019-10-30T14:42:28Z")

</div>

Hello everyone,

I need to count a string field, to create a percentage graph. I've tried script fields but this one doesn't work with typos string.  
I wear this:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/7/372f0d8faf06be437f0cb96098286389e1694da2.png)

Any ideas ?, thank you very much

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [November 1, 2019, 3:07pm UTC](https://discuss.elastic.co/t/count-the-number-of-text-type-records/205883/2 "2019-11-01T15:07:08Z")

</div>

Can you describe your use case a bit more. Do you want the unique count of string fields? Have you tried [cardinality aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html)

 ![49%20AM](https://us1.discourse-cdn.com/elastic/original/3X/4/1/41e3e01326dcbc3ad3c4af833e901d54e724ba82.png)

---

<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 29, 2019, 3:07pm UTC](https://discuss.elastic.co/t/count-the-number-of-text-type-records/205883/3 "2019-11-29T15:07:11Z")

</div>

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