07 Sep 2023 08:43 AM
Hi,
I have created a variable group_by in Dashboards/Notrbook to be able to group the result of a query. But I don't know how to transform this string into a valid value:
fetch events
| filter event.kind == "DAVIS_PROBLEM"
| summarize {count = count(),event.status_transition = takeLast(event.status)}, by: {status = event.status_transition,`interval` = bin(timestamp, $group_by)}
I haven't seen how I can do that in the documentation: https://www.dynatrace.com/support/help/platform/grail/dynatrace-query-language/functions
Many thanks
Solved! Go to Solution.
08 Sep 2023 07:54 AM
There is a similar example in our help: https://www.dynatrace.com/support/help/shortlink/dashboard-component-variable#resolution-in-dql-comm...
Just add 2 variables to dashboard, one for resolution and one for unit.
Then the query can look like this:
fetch events
| filter event.kind == "DAVIS_PROBLEM"
| fieldsAdd toDuration(multiplier)
| summarize {count = count(),event.status_transition = takeLast(event.status)}, by: {status = event.status_transition,`interval` = bin(timestamp, duration($resolution, unit:$unit))}
Best,
Sini