Return Multiple Items from Variables in Dynatrace DQL Dashboards

Summary: This article explains how to configure DQL queries to return multiple items from variables in dashboards. It includes syntax examples and tips for dynamic data visualisation in Dynatrace.

Hi,

I’m trying to code a variable filter in the new generation dashboards to return multiple values if a user/me chooses.

I have an example where I have tags applied to a number of hosts. In total, I have about 8 groups of hosts and they display their cost. In a normal view, there will be 8 bars or 8 items on the screen. Now, when I have a variable such as this:

| filter field == $Variable

…and I filter to one item, it does that successfully. Its only when it becomes 2 or more that it fails and returns back:

“Too many positional parameters have been defined.”

Is there a way for me to have a selection to choose from?

Yes. This is the way to do it:

| filter in(field,array($Variable))

Kris

The reason this solution works is because when you allow multi select on a variable, it becomes an array.