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

Define business hours

sinisa_zubic
Dynatrace Champion
Dynatrace Champion

Hi Team, 

how could I define business hours with DQL? I looked at filtering on the timestamp but can't really find a way. For example: for monday to friday, 08am to 7pm.
 
Best,
Sini
1 REPLY 1

educampver
Dynatrace Advisor
Dynatrace Advisor

Hi Sinisa, the Notebooks app has a snippet for this use case:Screenshot 2023-06-01 at 8.37.21 AM.png

Here's the query anyways:

 

fetch bizevents, from:now()-7d, to:now()
| fieldsAdd hour=toLong(formatTimestamp(timestamp,format:"H")), day_of_week = formatTimestamp(timestamp,format:"EE")
| filterOut day_of_week == "Sat" or day_of_week == "Sun" // Remove weekend days
| filterOut hour <= 5 or hour >= 15 // Remove everything that is not between 5am and 3pm

 

Featured Posts