# Create bar visualization with count multiple boolean variables

**URL:** <https://discuss.elastic.co/t/create-bar-visualization-with-count-multiple-boolean-variables/259904>\
**Category:** Kibana\
**Created:** [December 30, 2020, 6:01pm UTC](https://discuss.elastic.co/t/create-bar-visualization-with-count-multiple-boolean-variables/259904 "2020-12-30T18:01:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joao\_Palma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joao_palma/32/45243_2.png) [@Joao\_Palma](https://discuss.elastic.co/u/Joao_Palma)\
**Post date:** [December 30, 2020, 6:01pm UTC](https://discuss.elastic.co/t/create-bar-visualization-with-count-multiple-boolean-variables/259904/1 "2020-12-30T18:01:54Z")

</div>

Hello,

I have an log like this:  
{"option1":"false", "option2":"true", "option3":"false"}  
{"option1":"true", "option2":"true", "option3":"false"}  
{"option1":"false", "option2":"true", "option3":"true"}  
...  
And I want generate one visualization like this:  
oprtion1 - 1 true 2 false  
option2 - 3 true  
option3 - 1 true 2 false

How I can do this?

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [December 30, 2020, 6:44pm UTC](https://discuss.elastic.co/t/create-bar-visualization-with-count-multiple-boolean-variables/259904/2 "2020-12-30T18:44:46Z")

</div>

This type of visualization is only possible using Vega because you're looking at _individual documents_, not _aggregated data_. Vega can't build tables, but it can build simple graphical charts.

If you want to construct this using an aggregated chart builder, you would need to change your document structure. But with the documents you've shown, you have limited options.

---

<div class="post-metadata">

**Author:** ![Joao\_Palma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joao_palma/32/45243_2.png) [@Joao\_Palma](https://discuss.elastic.co/u/Joao_Palma)\
**Post date:** [December 30, 2020, 7:17pm UTC](https://discuss.elastic.co/t/create-bar-visualization-with-count-multiple-boolean-variables/259904/3 "2020-12-30T19:17:27Z")

</div>

> [@wylie](#):
>
> want to construct this using an aggregated chart builder, you would need to change your document structure. But with the documen

Thanks Wylie! You can send me a example in Vegas or something related?

"But with the documents you've shown, you have limited options." this is a part of log for making simple of understand... But i think i can change structure in logstash, what you recommend?

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [December 30, 2020, 7:24pm UTC](https://discuss.elastic.co/t/create-bar-visualization-with-count-multiple-boolean-variables/259904/4 "2020-12-30T19:24:00Z")

</div>

I just thought of a workaround where you can create an aggregated chart. For your buckets, choose the Filters aggregation. Create 6 filters, one for each combination of option and true/false value. For example `option1: false`, `option1: true`, `option2: false`, etc. This is support in tables, bar charts, pie charts, etc.

---

<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:** [January 27, 2021, 7:24pm UTC](https://discuss.elastic.co/t/create-bar-visualization-with-count-multiple-boolean-variables/259904/5 "2021-01-27T19:24:02Z")

</div>

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