# Data Quantity in Kibana

**URL:** <https://forum.avicennaresearch.com/t/data-quantity-in-kibana/1239>\
**Category:** Reference\
**Created:** [June 16, 2025, 9:18am UTC](https://forum.avicennaresearch.com/t/data-quantity-in-kibana/1239 "2025-06-16T09:18:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mojtaba](https://forum.avicennaresearch.com/letter_avatar_proxy/v4/letter/m/e56c9b/32.png) [@mojtaba](https://forum.avicennaresearch.com/u/mojtaba)\
**Post date:** [June 16, 2025, 9:18am UTC](https://forum.avicennaresearch.com/t/data-quantity-in-kibana/1239/1 "2025-06-16T09:18:49Z")

</div>

## Plot Data Quantity using Kibana

In this article, we describe how you use Kibana to monitor the number of data records each participant uploads during a certain time period. If you are not familiar with how Kibana works with Avicenna, you can read the [Kibana Basics](https://forum.avicennaresearch.com/t/kibana-basics/1289) page first and then continue here.

Start by opening Kibana from your Researcher Dashboard. Now from the left panel, go to the _Visualize_ tab, click on the `Create Visualization` button and from the list choose _Heat Map_ visualization. In the dialog that opens, search for the data index you want to use. Here, we want to use the Pedometer data, so we search for it in the list:

 ![Choose data source for the Kibana Heatmap Visualization](https://forum.avicennaresearch.com/uploads/default/original/1X/8161c54450e551969b3bc6b682aac4287fca692d.png)

After selecting the data source, a graph is shown based on the default parameters. We need to adjust these parameters using the left-side panel:

| |
| --- |
| ![Kibana Heatmap Visualization Options](https://forum.avicennaresearch.com/uploads/default/original/1X/3f1ff4983473997e386e2be3df588e5c297642f1.png) |

In the Data tab, in the _Metrics_ section, expand the `Value Count` and ensure the _Aggregation_ is set to _Count_ (the default option). This specifies that for each cell of our heat map (or for each bucket, as called in Kibana), we want to count the number of records in that bucket and plot the aggregate result. If you are not familiar with how metrics and buckets work in Elasticsearch and Kibana, [this 10-minute video](https://www.youtube.com/watch?v=j-eCKDhj-Os) is a good introduction.

Then we need to define our buckets. For this example, we want to show user IDs in the X-Axis and dates on the Y-Axis. We can define that in the _Buckets_ section. Click on the `+` icon, choose _X-Axis_, from the _Aggregations_ list select _Terms_, and set the _Field_ to `user_id`. You can specify the order of the data by setting the _Order By_ field. The last field is the _Size_. You can use _Size_ to specify how many user IDs to be returned. Here I set it to 20.

| |
| --- |
| ![Kibana Heatmap Visualization Options](https://forum.avicennaresearch.com/uploads/default/original/1X/a7049cda54004b5c060f585990b07b24a57600ec.png) |

To specify the _Y-Axis_, click on `+` again, and choose _Y-Axis_. We want to aggregate the data per date. So choose _Date Histogram_ and set the Field value to `record_time`. Also, set the interval to _Daily_, so the plot will show aggregate data over date. When done, click on the `Update` button on the bottom right corner of the panel to apply the changes.

| |
| --- |
| ![Kibana Heatmap Visualization Options](https://forum.avicennaresearch.com/uploads/default/original/1X/e1aee35108413a5219b279ca9898b804fa2f135d.png) |

Also, don’t forget to select a time window from the top right corner of the page. By default, it’s set to show the data from the last 15 minutes. But for most cases, there is not enough data to plot and you will get an empty graph. Here I set the time range to the past 15 weeks instead:

 ![Kibana Data Quantity Heatmap](https://forum.avicennaresearch.com/uploads/default/original/1X/04cee27cb39ba12630e2b6a6a715483ac0ae7c7e.png)

As I only had one participant in my study, the X access has only one item. You can move the cursor on the graph, and for each cell you can see the date, the user ID, and the number of records that user has provided on that date.

You can also use filters to put criteria on the records which are being counted. This filter can be based on any field in the data. Obviously, you can filter data to include or exclude specific users. Moreover, as we are using GPS data here, you can filter data based on a specific geo-region, or the speed. To do that, simply click on the `Add a filter` on the top left corner of the screen, and you can define your filter.

### Special Case: Survey Responses

The above example counts the number of records stored in Kibana for each user for each date. This generates a valid data quantity report for all data sources in Avicenna, except Survey Responses. As we [explained before](https://forum.avicennaresearch.com/t/kibana-basics/1289#p-2916-survey-responses-4), Avicenna stores response to each question as a separate record. So if a survey has 10 questions and the user responds to 8 of them, Avicenna will store 8 separate records for that session, one per response. Each record contains 5 date fields: `scheduled_time`, `issued_time`, `record_time`, `rel_record_time`, and `resp_time`. You can read more about each of these fields [here](https://forum.avicennaresearch.com/t/kibana-basics/1289#p-2916-survey-responses-4). Except `resp_time`, all other 4 fields are identical for all responses to a specific session. So in the example above, all 8 responses will contain identical values for `scheduled_time`, `issued_time`, `record_time`, and `rel_record_time`.

So if you want to count the number of survey sessions per participant per day, all configuration remains the same as above, except the metric. For metric, you need to use you need to set the metric to Unique Count of one of the 4 date values, as shown below.

| |
| --- |
| ![Configuration for Plotting Survey Responses](https://forum.avicennaresearch.com/uploads/default/original/1X/e58b454e2804c82cd0bca34a6cfb8b8a072c64a4.png) |
| Configuration for Plotting Survey Responses |
