# Transform boolean values from True / False to 1/0

**URL:** https://discuss.elastic.co/t/transform-boolean-values-from-true-false-to-1-0/189936
**Category:** Kibana
**Created:** [July 11, 2019, 8:14am UTC](https://discuss.elastic.co/t/transform-boolean-values-from-true-false-to-1-0/189936 "2019-07-11T08:14:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MARCO\_RAMBALDI](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_rambaldi/32/46108_2.png) [@MARCO\_RAMBALDI](https://discuss.elastic.co/u/MARCO_RAMBALDI)
#### Post date: [July 11, 2019, 8:14am UTC](https://discuss.elastic.co/t/transform-boolean-values-from-true-false-to-1-0/189936/1 "2019-07-11T08:14:12Z")

</div>

I have IoT alarms in Boolean format: True / False.  
But I would like to show the trend of these alarms over time. How can I do it? Is it possible to turn True / False into 1/0 on Kibana? In this way it would be more convenient to show their progress.

---

<div class="post-metadata">

### Author: ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)
#### Post date: [July 12, 2019, 9:25am UTC](https://discuss.elastic.co/t/transform-boolean-values-from-true-false-to-1-0/189936/2 "2019-07-12T09:25:56Z")

</div>

The best way to do it would be to convert them between the IoT device and Elasticsearch. Logstash if you're using it.  
Otherwise, you could use a scripted field that reads the value of that field and returns 1 or 0 accordingly.

---

<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: [August 9, 2019, 9:27am UTC](https://discuss.elastic.co/t/transform-boolean-values-from-true-false-to-1-0/189936/3 "2019-08-09T09:27:18Z")

</div>

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