cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DQL future placeholder dates

loopy
Frequent Guest

Is there a way in DQL or dashboards to show the data for today and the next 7 days as 0 until we go past those days? Idea being showing each day from the Monday how many records are returned until the Sunday then the graph resets. 

Eg in DQL return this table as there is only data for todays date, show 0 for the rest of the week. 

Date Count
2025-09-22 254
2025-09-23 0
2025-09-24 0
2025-09-25 0
2025-09-26 0
2025-09-27 0
2025-09-28 0

 

1 REPLY 1

krzysztof_hoja
Dynatrace Champion
Dynatrace Champion

Yes, you can just add the placeholders into your data, like this:

fetch bizevents, from: @w1
| summarize cnt=count(), by: { timestamp=timestamp@d }
| append [
  data record(timestamp=array(
    @w1,
    @w1+1d,
    @w1+2d,
    @w1+3d,
    @w1+4d,
    @w1+5d,
    @w1+6d
  ))
  | expand timestamp
  | fieldsAdd cnt=0
]
| summarize cnt=sum(cnt), by: {timestamp}
| sort timestamp asc

 

I am counting bizevents since beginning of week set on beginning od Monday (@w1) .
After adding placeholders I summarize again using sum(), so placeholder are deduplicates and do nothing to existing data as 0 is neutral.

krzysztof_hoja_0-1758558450577.png

 

 

Featured Posts