# Fix DQL makeTimeseries Error: Parameter Must Be an Expression

**URL:** <https://community.dynatrace.com/t/fix-dql-maketimeseries-error-parameter-must-be-an-expression/54017>\
**Category:** DQL\
**Tags:** dql, notebooks, dpl, logs\
**Created:** [November 7, 2025, 8:55am UTC](https://community.dynatrace.com/t/fix-dql-maketimeseries-error-parameter-must-be-an-expression/54017 "2025-11-07T08:55:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anujjain504](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@anujjain504](https://community.dynatrace.com/u/anujjain504)\
**Post date:** [November 7, 2025, 8:55am UTC](https://community.dynatrace.com/t/fix-dql-maketimeseries-error-parameter-must-be-an-expression/54017/1 "2025-11-07T08:55:45Z")

</div>

_SPL:  
|chart values(Total) as Total by date\_hour,TimeDiffFinal_

_DQL_

_| makeTimeseries Total=collectDistinct(Total), by:{date\_hour, TimeDiffFinal}, time:LatestTime_

So, basically i have converted values into collectDistinct in dynatrace.

Getting ERROR -The parameter has to be an expression-based timeseries aggregation.

---

<div class="post-metadata">

**Author:** ![t\_pawlak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/t_pawlak/32/14991_2.png) [@t\_pawlak](https://community.dynatrace.com/u/t_pawlak)\
**Post date:** [November 7, 2025, 2:34pm UTC](https://community.dynatrace.com/t/fix-dql-maketimeseries-error-parameter-must-be-an-expression/54017/2 "2025-11-07T14:34:13Z")

</div>

Hi,  
I think, that the error happens because makeTimeseries requires a numeric aggregation (e.g., countDistinct, sum, avg, last), while collectDistinct() returns a list, which can’t form a timeseries.

You can try with this:

```markup
fetch logs, scanLimitGBytes: -1
| summarize Total_list = collectDistinct(Total),
  by: { date_hour = bin(timestamp, 1h), TimeDiffFinal }
| sort date_hour asc, TimeDiffFinal asc

```

You should recive table and list of values
