# Tracking number of value changes of boolean field in time series

**URL:** https://discuss.elastic.co/t/tracking-number-of-value-changes-of-boolean-field-in-time-series/290425
**Category:** Kibana
**Created:** [November 29, 2021, 11:05am UTC](https://discuss.elastic.co/t/tracking-number-of-value-changes-of-boolean-field-in-time-series/290425 "2021-11-29T11:05:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![DennisKlopfer](https://avatars.discourse-cdn.com/v4/letter/d/e5b9ba/32.png) [@DennisKlopfer](https://discuss.elastic.co/u/DennisKlopfer)
#### Post date: [November 29, 2021, 11:05am UTC](https://discuss.elastic.co/t/tracking-number-of-value-changes-of-boolean-field-in-time-series/290425/1 "2021-11-29T11:05:06Z")

</div>

My time series data contains a boolean field, which changes frequently. I want to count the number of changes of said field.

Optimally I would like to create a field containing this number while ingesting, but showing the current count on a Kibana Dashboard suffices.

I came up with the following approaches:

- Calculate a cummulative sum over the boolean field, filter by negative values and output the cardinality of the result.
- Use serial\_diff on the boolean field and sum over the result.

However I was not able to construct said queries or find dashboard functionality to represent this behaviour. Help is greatly appreceated.

---

<div class="post-metadata">

### Author: ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)
#### Post date: [November 29, 2021, 6:31pm UTC](https://discuss.elastic.co/t/tracking-number-of-value-changes-of-boolean-field-in-time-series/290425/2 "2021-11-29T18:31:05Z")

</div>

Dashboards do no expose the ability to derive fields from multiple documents. To show this value in Kibana, you will need to store the value in the document.

---

<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: [December 27, 2021, 6:31pm UTC](https://discuss.elastic.co/t/tracking-number-of-value-changes-of-boolean-field-in-time-series/290425/3 "2021-12-27T18:31:23Z")

</div>

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