Variables of specific Type

Is there a way to specify a dashboard variable of type “duration”?
Or a way to convert a string to a duration within the makeTimeseries command, like this?

Aggregation = 1d,7d,30d

fetch logs, scanLimitGBytes: 5000
| filter isNotNull(k8s.deployment.name)
| filter loglevel == "INFO"
| fields k8s.deployment.name, chars=stringLength(content), timestamp
| makeTimeseries sum_content_chars=sum(chars), by: {k8s.deployment.name}, interval:asDuration($Aggregation)

The above DQL fails with “Execution failed with error: failure to statically evaluate expression”

E.g. with duration(toLong($resolution), unit:“m”))}

FInd an example here: Add a variable to a dashboard — Dynatrace Docs

I tried that before in this form:

...
| makeTimeseries sum_content_chars=sum(chars), by: {k8s.deployment.name}, interval:duration(toLong($Aggregation),unit:d)

However this didn’t work:
“The parameter `interval` has to be constant, but `duration(toLong(“1”), d)` accesses data.”

odd seems like there have been some changes.

What works for me is the following, where I just pass the unit as a second parameter:

timeseries avg(dt.host.cpu.idle), interval: duration(toLong(“2”),“d”)

*Facepalm*…unit has to be a string!

| makeTimeseries sum_content_chars=sum(chars), by: {k8s.deployment.name}, interval:duration(toLong($Aggregation),unit:"d")

That works, also if the unit itself is a variable

Totally missed the quotation marks! Well cool then I am happy it works for you! Keep us in the loop when you face other issues! Always on the lookout for variable feedback.