# How to use ES|QL control value as a filter

**URL:** https://discuss.elastic.co/t/how-to-use-es-ql-control-value-as-a-filter/379716
**Category:** Kibana
**Tags:** esql
**Created:** [July 2, 2025, 3:14pm UTC](https://discuss.elastic.co/t/how-to-use-es-ql-control-value-as-a-filter/379716 "2025-07-02T15:14:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![tallakh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tallakh/32/8860_2.png) [@tallakh](https://discuss.elastic.co/u/tallakh)
#### Post date: [July 2, 2025, 3:14pm UTC](https://discuss.elastic.co/t/how-to-use-es-ql-control-value-as-a-filter/379716/1 "2025-07-02T15:14:06Z")

</div>

Hi!

I'm testing out ES|QL controls in a dashboard, but I'm not able to use it as I expected. I've created a control with static values, but using the variable name in the query fails.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/3/b3f4f764051e04c9986073571ffa196837677bfd.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/b/7b4046a5dae37ec6e9fc91dccb939023c053c9a2.png)

According to [this](https://www.elastic.co/docs/explore-analyze/dashboards/add-controls) documentation that should be possible?

Cheers,  
Tallak

---

<div class="post-metadata">

### Author: ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)
#### Post date: [July 3, 2025, 3:49am UTC](https://discuss.elastic.co/t/how-to-use-es-ql-control-value-as-a-filter/379716/2 "2025-07-03T03:49:55Z")

</div>

Hello @tallakh

I tried the same for the demo index following the documentation and did not see any problem :

 ![Screenshot 2025-07-03 053717](https://us1.discourse-cdn.com/elastic/original/3X/1/8/184771ff6ab63cb8913ff14de205dca54b6ce4a6.png)

 ![Screenshot 2025-07-03 053649](https://us1.discourse-cdn.com/elastic/original/3X/a/e/aef934def80d41927953af50a53049e2ffaa5e13.png)

Maybe try to write the query again as i do not see any issues.

Thanks!!

---

<div class="post-metadata">

### Author: ![tallakh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tallakh/32/8860_2.png) [@tallakh](https://discuss.elastic.co/u/tallakh)
#### Post date: [July 4, 2025, 5:21am UTC](https://discuss.elastic.co/t/how-to-use-es-ql-control-value-as-a-filter/379716/3 "2025-07-04T05:21:39Z")

</div>

Thanks! I'm not sure what I did wrong, but I got it working.

---

<div class="post-metadata">

### Author: ![bjornbear](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@bjornbear](https://discuss.elastic.co/u/bjornbear)
#### Post date: [July 7, 2025, 11:05am UTC](https://discuss.elastic.co/t/how-to-use-es-ql-control-value-as-a-filter/379716/4 "2025-07-07T11:05:18Z")

</div>

I am trying exactly the same, but I simply cannot get this control to work: It always reports an error with the column (and the value corresponding to the first value of the control).

I have tried different browsers, all with the same outcome. Any suggestions please?

---

<div class="post-metadata">

### Author: ![Tortoise](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tortoise/32/147587_2.png) [@Tortoise](https://discuss.elastic.co/u/Tortoise)
#### Post date: [July 9, 2025, 4:20am UTC](https://discuss.elastic.co/t/how-to-use-es-ql-control-value-as-a-filter/379716/5 "2025-07-09T04:20:27Z")

</div>

Hello @bjornbear

Could you please share the kibana version, screenshot of the error in order to review why it is not working for you?

Thanks!!
