# \*Solved\* Dashboard time range is not applied to variable query

**URL:** <https://community.grafana.com/t/solved-dashboard-time-range-is-not-applied-to-variable-query/100455>\
**Category:** Configuration\
**Tags:** dashboard-variables\
**Created:** [August 3, 2023, 9:36pm UTC](https://community.grafana.com/t/solved-dashboard-time-range-is-not-applied-to-variable-query/100455 "2023-08-03T21:36:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akakumani](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akakumani](https://community.grafana.com/u/akakumani)\
**Post date:** [August 3, 2023, 9:36pm UTC](https://community.grafana.com/t/solved-dashboard-time-range-is-not-applied-to-variable-query/100455/1 "2023-08-03T21:36:26Z")

</div>

- What Grafana version and what operating system are you using?

- **What** are you trying to achieve?

from: [Elasticsearch query editor | Grafana documentation](https://grafana.com/docs/grafana/latest/datasources/elasticsearch/query-editor/)

`{"find": "terms", "field": "hostname.keyword", "size": 1000}`

Returns a list of values for a keyword using term aggregation. **Query will use current dashboard time range as time range query.**

However when I do my query:

{“find”:“terms”, “field”:“tag.my\_variable.keyword”, “size”: 25}

I see the same set of alphabetized variables from any dashboard time ranges. The list of “my\_variable” is changing constantly and at many points should be blank.

- **How** are you trying to achieve it?

Messing with the variable query options. I cannot find any reliable documentation on the full list of query options I can do. All I can see are the few options on here: [Elasticsearch query editor | Grafana documentation](https://grafana.com/docs/grafana/latest/datasources/elasticsearch/query-editor/)

from which there’s little to extrapolate on the various things I believe I can pass in to a grafana query.

- What happened?

I see the same set of alphabetized variables from any dashboard time ranges. The list of “my\_variable” is changing constantly and at many points should be blank.

- What did you **expect** to happen?

The list of my\_variable should change.

- Can you copy/paste the configuration(s) that you are having problems with?

pasted above.

- Did you receive any errors in the Grafana UI or in related logs? If so, please tell us **exactly** what they were.

no errors.

- Did you follow any online instructions? If so, what is the URL?

url shared above.

---

<div class="post-metadata">

**Author:** ![akakumani](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akakumani](https://community.grafana.com/u/akakumani)\
**Post date:** [August 3, 2023, 9:56pm UTC](https://community.grafana.com/t/solved-dashboard-time-range-is-not-applied-to-variable-query/100455/2 "2023-08-03T21:56:27Z")

</div>

My data was the issue here. This is working as expected.
