# Counting unique values in y axis of a line/bar visualization

**URL:** <https://discuss.elastic.co/t/counting-unique-values-in-y-axis-of-a-line-bar-visualization/215272>\
**Category:** Kibana\
**Created:** [January 16, 2020, 8:59am UTC](https://discuss.elastic.co/t/counting-unique-values-in-y-axis-of-a-line-bar-visualization/215272 "2020-01-16T08:59:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Omer\_Botenski](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/omer_botenski/32/60870_2.png) [@Omer\_Botenski](https://discuss.elastic.co/u/Omer_Botenski)\
**Post date:** [January 16, 2020, 8:59am UTC](https://discuss.elastic.co/t/counting-unique-values-in-y-axis-of-a-line-bar-visualization/215272/1 "2020-01-16T08:59:45Z")

</div>

Hi there!

I'm trying to create a line/bar visualization based upon a query which returns all tests I run on my system. The main goal is to show a count of unique test titles on the Y axis (since some tests run several times a day, and I only need to which ran that day, not how many times), while the x axis is date histogram with a day interval and split series of the test titles.  
The visualization shows all of the tests which ran that day. Looks like this:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/8/781eb67d17a053106edcf85415b3652b59739be5.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/9/d98748cf25f67cd8613bce0a09de0f5256f07046.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/6/767a23d535dbcf54a526bc68826b126fe5d30318.png)

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [February 6, 2020, 1:49pm UTC](https://discuss.elastic.co/t/counting-unique-values-in-y-axis-of-a-line-bar-visualization/215272/2 "2020-02-06T13:49:15Z")

</div>

Hi there, if you want to visualize the daily unique count for test, just use Unique count as metric on the test name field (like you are already doing) and use only a date histogram on the x axis. You don't have to split series because this will perform the following:  
on each daily bucket, group all the documents by the `fullName_keyword` field, then on each group of documents (on each test) apply the unique count on the same field. This will result in a stacked bar chart each bar of height 1.  
If you remove the `split Series` aggregation it should work as desired

---

<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:** [March 5, 2020, 1:49pm UTC](https://discuss.elastic.co/t/counting-unique-values-in-y-axis-of-a-line-bar-visualization/215272/3 "2020-03-05T13:49:16Z")

</div>

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