# Apply variable values in filter with entitySelector

**URL:** <https://community.dynatrace.com/t/apply-variable-values-in-filter-with-entityselector/40707>\
**Category:** DQL\
**Tags:** dql, entity-selector, dashboards\
**Created:** [July 14, 2023, 3:26pm UTC](https://community.dynatrace.com/t/apply-variable-values-in-filter-with-entityselector/40707 "2023-07-14T15:26:48Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![dmezynski](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@dmezynski](https://community.dynatrace.com/u/dmezynski)\
**Post date:** [March 12, 2025, 3:21pm UTC](https://community.dynatrace.com/t/apply-variable-values-in-filter-with-entityselector/40707/5 "2025-03-12T15:21:53Z")

</div>

I’m doing this same thing and am having issues with displaying as a time series on a dashboard.

```markup
timeseries cpu=avg(dt.host.cpu.usage), by:{dt.entity.host}
| lookup [fetch dt.entity.host], sourceField:dt.entity.host, lookupField:id, fields:{tags}
| filter isNotNull(tags)
| expand tags
| parse tags, """((LD:tag (!<<'\\' ':') LD:value)|LD:tag)"""
| fieldsAdd tag = replaceString(tag,"""\:""", ":"), value = replaceString(value, """\:""", ":")
| fieldsAdd client = if(tag == "client", value)
| fieldsAdd environment_type = if(tag == "environment_type", value)
| fieldsAdd function = if(tag == "function", value)
| summarize {cpu = takeAny(cpu), 
  client=arrayMin(collectArray(client)),
  environment_type = arrayMin(collectArray(environment_type)),
  function = arrayMin(collectArray(function))}
  , by:{dt.entity.host}
| filter in(client, array($Client)) and 
  in(environment_type, array($Environment))

```

The data set comes out like this (with the tag values not shown):

 ![dmezynski_0-1741792797748.png](https://global.discourse-cdn.com/dynatrace/original/2X/8/8dba01fa9a9c0b02a0a469402c95777750bd2eac.png)

The dashboard is telling my the data is not suitable for a graph:

 ![dmezynski_1-1741792898506.png](https://global.discourse-cdn.com/dynatrace/original/2X/e/ec6acf22837204f598db689ce208e5399e04c10f.png)

Any help would be appreciated.

---

_[View the full topic](https://community.dynatrace.com/t/apply-variable-values-in-filter-with-entityselector/40707)._
