# Vega filter with controls in dashboard

**URL:** <https://discuss.elastic.co/t/vega-filter-with-controls-in-dashboard/230596>\
**Category:** Kibana\
**Created:** [April 30, 2020, 4:52pm UTC](https://discuss.elastic.co/t/vega-filter-with-controls-in-dashboard/230596 "2020-04-30T16:52:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nb03briceno](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nb03briceno/32/45777_2.png) [@nb03briceno](https://discuss.elastic.co/u/nb03briceno)\
**Post date:** [April 30, 2020, 4:52pm UTC](https://discuss.elastic.co/t/vega-filter-with-controls-in-dashboard/230596/1 "2020-04-30T16:52:00Z")

</div>

Hello everyone,  
Hope one of you can help me, i would like to know if it is possible to use control filters on a vega visualization that involves aggregations, and queries. In my example, i'm trying to filter by a particular day field the whole graph generated by vega.

Do you have any insight about how to do this??

Here, i have some pictures and the code of vega.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/7/07d80a44f2061601091ae7ecceac46f28d046517.jpeg)

{  
"$schema": "[https://vega.github.io/schema/vega-lite/v2.json](https://vega.github.io/schema/vega-lite/v2.json)",  
"title": "Daily Count",  
"data": {  
"url": {  
"index": "hs\_index",  
"body": {  
"size": 0,  
"track\_total\_hits": true,  
"query": {  
"match": {  
"order\_sent": "ORDER/INSERT"  
}  
},  
"aggregations": {  
"order\_over\_time": {  
"date\_histogram": {  
"field": "@timestamp",  
"format": "yyyy-MM-dd hh:mm-ss",  
"interval": "15m"  
}  
}  
}  
}  
},  
"format": {"property": "aggregations.order\_over\_time.buckets"}  
},  
"mark": "bar",  
"encoding": {  
"x": {"field": "key", "type": "temporal", "axis": {"title": false}},  
"y": {  
"field": "doc\_count",  
"type": "quantitative",  
"axis": {"title": "# of orders"}  
},

```
color: {"value": "#ff9900"},

legend: { title: 'Memory_serie' }

```

}  
{  
"$schema": "[https://vega.github.io/schema/vega-lite/v2.json](https://vega.github.io/schema/vega-lite/v2.json)",  
"title": "Daily Count",  
"data": {  
"url": {  
"index": "hs\_index",  
"body": {  
"size": 0,  
"track\_total\_hits": true,  
"query": {  
"match": {  
"order\_sent": "ORDER/INSERT"  
}  
},  
"aggregations": {  
"order\_over\_time": {  
"date\_histogram": {  
"field": "@timestamp",  
"format": "yyyy-MM-dd hh:mm-ss",  
"interval": "15m"  
}  
}  
}  
}  
},  
"format": {"property": "aggregations.order\_over\_time.buckets"}  
},  
"mark": "bar",  
"encoding": {  
"x": {"field": "key", "type": "temporal", "axis": {"title": false}},  
"y": {  
"field": "doc\_count",  
"type": "quantitative",  
"axis": {"title": "# of orders"}  
},

```
color: {"value": "#ff9900"},

legend: { title: 'Memory_serie' }

```

}  
}

Thanks so much,

JUAN DAVID BRICENO GUERERO

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [May 4, 2020, 9:24pm UTC](https://discuss.elastic.co/t/vega-filter-with-controls-in-dashboard/230596/2 "2020-05-04T21:24:40Z")

</div>

Sadly no, Vega queries elasticsearch independently, not through Kibana mquery so the filters on a dashboard won't have any effect on Vega.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 1, 2020, 9:24pm UTC](https://discuss.elastic.co/t/vega-filter-with-controls-in-dashboard/230596/3 "2020-06-01T21:24:41Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
