# How to add multiple fields in cardinality

**URL:** <https://discuss.elastic.co/t/how-to-add-multiple-fields-in-cardinality/307274>\
**Category:** Kibana\
**Created:** [June 15, 2022, 12:35pm UTC](https://discuss.elastic.co/t/how-to-add-multiple-fields-in-cardinality/307274 "2022-06-15T12:35:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NAVEEN\_MEENA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/naveen_meena/32/100962_2.png) [@NAVEEN\_MEENA](https://discuss.elastic.co/u/NAVEEN_MEENA)\
**Post date:** [June 15, 2022, 12:35pm UTC](https://discuss.elastic.co/t/how-to-add-multiple-fields-in-cardinality/307274/1 "2022-06-15T12:35:53Z")

</div>

Hi all ,  
I have created a table visualization in kibana 7.7 and there are 2 metrics of unique count fields present in the table and one bucket .Let's say time1 and time2 are 2 metrics of unique count and let's say the name of bucket is device I want count of all the entries which have time1 as fields in one column and count of all entries which have time2 as fields .But the issue with unique count is if I have different entry having same value of time1 then it will count as 1 but I want it count as different .So in my entry I have another field "id" which is unique for every entry .

So can I create a table with two cardinality fields of time1 and id for 1 table and time2 and id for another table

Thanks  
Naveen

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [June 16, 2022, 7:16am UTC](https://discuss.elastic.co/t/how-to-add-multiple-fields-in-cardinality/307274/2 "2022-06-16T07:16:30Z")

</div>

Hi @NAVEEN_MEENA ,

welcome to the Kibana community!  
If you can upgrade your instance I think you can leverage the power of runtime fields to compone a new field with the composition of the `timeX` field + `id` field, the compute the unique count on this new field.  
You can read more about runtime field here: [Getting started with runtime fields, Elastic’s implementation of schema on read | Elastic Blog](https://www.elastic.co/blog/getting-started-with-elasticsearch-runtime-fields)

In 7.7 you might achieve a similar result using scripted fields, but performance will be a problem for high volume of data (which has been solved with runtime fields in newer versions).

---

<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:** [July 14, 2022, 7:16am UTC](https://discuss.elastic.co/t/how-to-add-multiple-fields-in-cardinality/307274/3 "2022-07-14T07:16:40Z")

</div>

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