# Able to Calculate Metrics, Unable to Visualize as Graphs \[beginner\]

**URL:** <https://discuss.elastic.co/t/able-to-calculate-metrics-unable-to-visualize-as-graphs-beginner/351146>\
**Category:** Kibana\
**Tags:** elastic-stack-graph\
**Created:** [January 16, 2024, 10:07am UTC](https://discuss.elastic.co/t/able-to-calculate-metrics-unable-to-visualize-as-graphs-beginner/351146 "2024-01-16T10:07:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scharka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/scharka/32/130821_2.png) [@Scharka](https://discuss.elastic.co/u/Scharka)\
**Post date:** [January 16, 2024, 10:07am UTC](https://discuss.elastic.co/t/able-to-calculate-metrics-unable-to-visualize-as-graphs-beginner/351146/1 "2024-01-16T10:07:45Z")

</div>

I'm new to Kibana, and I can't seem to figure out a completely trivial thing. Can you please point me in the right direction? I tried searching & googling, but I was not able to move on for more days.

**Minimal working example:**

**data**

| sentence | article | is\_about\_cat |
| --- | --- | --- |
| Cat drinks milk. | A | YES |
| Dog drinks milk. | A | NO |
| I love you. | B | NO |
| You love me. | B | NO |
| Cat is an animal. | C | YES |
| Sky is blue. | C | NO |
| Blood is red. | C | NO |
| I don´t know. | D | NO |
| You don't know. | D | NO |

**What I want:**  
I want to know how many articles are about cats = have at least one sentence that has "YES" in "is\_about\_cat" column. (Which is true for 2 articles in the example data, A & C.)

**The visualization I can do** (if I am not wrong):  
Use **metrics** and show the number/percentage of articles that contain a sentence about a cat.

visualization -\> metrics  
`unique_count('article.keyword', kql='is_about_cat:"YES"')`

`unique_count('article.keyword', kql='is_about_cat:"YES"') / unique_count('article.keyword')`

**The visualization I want and don't know how to do:**  
I want to visualize the proportion and have a **graph** :

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/1/111866f4232b21a655cc48829792f4531957c821.png)

I can only do this graph for sentences (each line in the table). I tried visualisation & aggregation based visualisation, but I was not able to get to the right numbers.

**How can I make this visualization?**

Thank you for your time & help. 🙂

---

<div class="post-metadata">

**Author:** ![Scharka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/scharka/32/130821_2.png) [@Scharka](https://discuss.elastic.co/u/Scharka)\
**Post date:** [January 17, 2024, 8:47am UTC](https://discuss.elastic.co/t/able-to-calculate-metrics-unable-to-visualize-as-graphs-beginner/351146/2 "2024-01-17T08:47:54Z")

</div>

**(Edited after more testing.)**

I think that asking here and giving up on the issue gave my brain the strength to better define what threw me off here and made me think it is not possible.

When I do:

1. visualisation -\> chart
2. slice by: is\_about\_cat
3. size by: ` unique_count('article.keyword')`

It is quite close, but it shows: number of articles with at least one sentence with "YES" and numbers of "articles where there is at least one sentence with "NO in the is\_about\_cat column. (If I am not wrong.)

But I want number of articles with at least one sentence with "YES" and the rest...

How can I do that?

---

<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:** [February 14, 2024, 8:48am UTC](https://discuss.elastic.co/t/able-to-calculate-metrics-unable-to-visualize-as-graphs-beginner/351146/3 "2024-02-14T08:48:02Z")

</div>

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