# DQL - Time interval recording without data

**URL:** <https://community.dynatrace.com/t/dql-time-interval-recording-without-data/44341>\
**Category:** DQL\
**Tags:** dql, bizevents, notebooks\
**Created:** [February 28, 2024, 8:47am UTC](https://community.dynatrace.com/t/dql-time-interval-recording-without-data/44341 "2024-02-28T08:47:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gbaudart](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@gbaudart](https://community.dynatrace.com/u/gbaudart)\
**Post date:** [February 28, 2024, 8:47am UTC](https://community.dynatrace.com/t/dql-time-interval-recording-without-data/44341/1 "2024-02-28T08:47:27Z")

</div>

Hi there,

I’m currently working on BizEvent processing.  
I would like to get the number of occurrences of the selected event at 1 minute intervals.

Here is my request:

```markup
fetch bizevents
| fieldsAdd event.type == "TEST"
| filter isNotNull(responsebodyfull)
| fieldsAdd Timestamp = timestamp
| parse responsebodyfull, "JSON(strict=false):json"
| expand TestServiceResponses=json[TestServiceResponses]
| parse TestServiceResponses, """LD '"correlationId":' STRING:correlationId LD '"montantEncaisse":' INTEGER:MontantEncaisse LD '"nR":' INTEGER:n LD '"n":' INTEGER:nC LD '"offre":' STRING:offre LD '"formule":' STRING:formule"""
| filterOut isNull(correlationId)
| fields Timestamp, correlationId, nR, nC, offre, montantEncaisse
| summarize count=count(), by: {`1m interval` = bin(Timestamp, 1m)}

```

I get what I’m looking for for all the intervals where I have events. The problem is that the intervals where I don’t have any data don’t have the value “0”. They’re just not recorded…  
But I need them, because then I’d like to average the number of events per minute. To do this, I need to count all the minutes, not just the ones with data.

Here’s my current result, I’m missing all the data for the intervals between 5am and 5:36am:

 ![gbaudart_0-1709109879636.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/d/3d86104fccac701d872c5426e22e72fff41fc814.png)

---

<div class="post-metadata">

**Author:** ![PacoPorro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pacoporro/32/36087_2.png) [@PacoPorro](https://community.dynatrace.com/u/PacoPorro)\
**Post date:** [February 28, 2024, 10:27am UTC](https://community.dynatrace.com/t/dql-time-interval-recording-without-data/44341/2 "2024-02-28T10:27:40Z")

</div>

What about using a [metric extraction](https://docs.dynatrace.com/docs/platform-modules/business-analytics/ba-metric-extraction) and then using the [default(0)](https://docs.dynatrace.com/docs/shortlink/explorer#default-by) aggregator with the metric?

---

<div class="post-metadata">

**Author:** ![gbaudart](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@gbaudart](https://community.dynatrace.com/u/gbaudart)\
**Post date:** [February 28, 2024, 1:20pm UTC](https://community.dynatrace.com/t/dql-time-interval-recording-without-data/44341/3 "2024-02-28T13:20:51Z")

</div>

I would like to get the information I want without creating additional metrics (which would increase our DDU consumption).  
Isn’t there a way to add the equivalent of a “default(0)” to Grail/DQL?

---

<div class="post-metadata">

**Author:** ![gbaudart](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@gbaudart](https://community.dynatrace.com/u/gbaudart)\
**Post date:** [March 25, 2024, 9:11am UTC](https://community.dynatrace.com/t/dql-time-interval-recording-without-data/44341/4 "2024-03-25T09:11:48Z")

</div>

I found it possible to do this with the MakeTimeSeries function:

```markup
| makeTimeseries {NbCount=count(default:0)}, time:Timestamp, interval:1min
| expand NbCount
| summarize avg(NbCount)

```

You can even use “Expand” to do additional processing (SUM, AVG, etc.).

---

<div class="post-metadata">

**Author:** ![gbaudart](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@gbaudart](https://community.dynatrace.com/u/gbaudart)\
**Post date:** [March 25, 2024, 9:18am UTC](https://community.dynatrace.com/t/dql-time-interval-recording-without-data/44341/5 "2024-03-25T09:18:00Z")

</div>

However, this does not seem to work for time intervals of less than a minute.
