# Davis app trying to filter on weekdays only

**URL:** <https://community.dynatrace.com/t/davis-app-trying-to-filter-on-weekdays-only/50524>\
**Category:** Alerting\
**Tags:** problem-detection, davis, anomaly-detection\
**Created:** [March 2, 2025, 1:47pm UTC](https://community.dynatrace.com/t/davis-app-trying-to-filter-on-weekdays-only/50524 "2025-03-02T13:47:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![henk\_stobbe](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/henk_stobbe/32/30434_2.png) [@henk\_stobbe](https://community.dynatrace.com/u/henk_stobbe)\
**Post date:** [March 2, 2025, 1:47pm UTC](https://community.dynatrace.com/t/davis-app-trying-to-filter-on-weekdays-only/50524/1 "2025-03-02T13:47:32Z")

</div>

Hello,

Is it possible to filter on weekdays within anomaly detection?

Or is the a DQL weekday filter for timeseries?

KR Henk

---

<div class="post-metadata">

**Author:** ![p\_devulapalli](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/p_devulapalli/32/41590_2.png) [@p\_devulapalli](https://community.dynatrace.com/u/p_devulapalli)\
**Post date:** [March 13, 2025, 5:00am UTC](https://community.dynatrace.com/t/davis-app-trying-to-filter-on-weekdays-only/50524/2 "2025-03-13T05:00:24Z")

</div>

[@henk\_stobbe](https://community.dynatrace.com/user/11427)&nbsp;There is a&nbsp;getDayOfWeek function available in DQL that can be used with timeseries , but could not really get that working in anomaly detector …may be its not the right one to be used with AD

> **[Time functions](https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/functions/time-functions)**
>
> A list of DQL time functions.

Here is a query in a very crude form in case you want to try and experiment

```markup
timeseries {CPU_Util=avg(dt.host.cpu.usage),e=end()}, by: {dt.entity.host},interval:1h
| fieldsAdd CPU_Util_WD = if( getDayOfWeek(e[])>=1 and getDayOfWeek(e[])<=5, CPU_Util[] )
| fieldsRemove CPU_Util

```

 ![p_devulapalli_0-1741841882573.png](https://global.discourse-cdn.com/dynatrace/original/3X/7/e/7e1cdd5795095c68f62be490747e8cd572d1c883.png)
