# Return Multiple Items from Variables in Dynatrace DQL Dashboards

**URL:** <https://community.dynatrace.com/t/return-multiple-items-from-variables-in-dynatrace-dql-dashboards/48284>\
**Category:** DQL\
**Tags:** dql, dynatrace-managed, variables, dashboards\
**Created:** [October 11, 2024, 1:57pm UTC](https://community.dynatrace.com/t/return-multiple-items-from-variables-in-dynatrace-dql-dashboards/48284 "2024-10-11T13:57:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![badgerfifteen](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@badgerfifteen](https://community.dynatrace.com/u/badgerfifteen)\
**Post date:** [October 11, 2024, 1:57pm UTC](https://community.dynatrace.com/t/return-multiple-items-from-variables-in-dynatrace-dql-dashboards/48284/1 "2024-10-11T13:57:43Z")

</div>

_Summary:&nbsp;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?

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [October 11, 2024, 6:29pm UTC](https://community.dynatrace.com/t/return-multiple-items-from-variables-in-dynatrace-dql-dashboards/48284/2 "2024-10-11T18:29:39Z")

</div>

Yes. This is the way to do it:

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

```

Kris

---

<div class="post-metadata">

**Author:** ![StrangerThing](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/strangerthing/32/12182_2.png) [@StrangerThing](https://community.dynatrace.com/u/StrangerThing)\
**Post date:** [October 12, 2024, 2:44pm UTC](https://community.dynatrace.com/t/return-multiple-items-from-variables-in-dynatrace-dql-dashboards/48284/3 "2024-10-12T14:44:34Z")

</div>

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