Unique count two fields combined

Hi all,

For a pie chart, I am using unique count aggregation as the metric. However, I need to get the unique count when two fields combined. Is this possible using the advanced option in kibana visualizations?

As an example, If I have two fields as userId and companyName, I need the unique count of userId + companyName as the metric.

Thanks.

You can do this by creating a scripted field (Scripted fields | Kibana Guide [7.12] | Elastic) concatenating the values of the two original fields, then doing a unique count on that.

1 Like