# Make filter using own data in Vega Lite

**URL:** <https://discuss.elastic.co/t/make-filter-using-own-data-in-vega-lite/320223>\
**Category:** Kibana\
**Tags:** vega\
**Created:** [December 1, 2022, 7:58am UTC](https://discuss.elastic.co/t/make-filter-using-own-data-in-vega-lite/320223 "2022-12-01T07:58:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Irwan\_Kurniawan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/irwan_kurniawan/32/101755_2.png) [@Irwan\_Kurniawan](https://discuss.elastic.co/u/Irwan_Kurniawan)\
**Post date:** [December 1, 2022, 7:58am UTC](https://discuss.elastic.co/t/make-filter-using-own-data-in-vega-lite/320223/1 "2022-12-01T07:58:26Z")

</div>

I want to make heat map from this data that show date as x-axis and y-axis as y-axis.. I want to do filter that show only last week data.. Can help me about this? Thank you!

![image](https://us1.discourse-cdn.com/elastic/original/3X/9/9/9943bb69caf563120cbc4b56bd3d2de9eb3eff26.png)

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [December 28, 2022, 12:19pm UTC](https://discuss.elastic.co/t/make-filter-using-own-data-in-vega-lite/320223/2 "2022-12-28T12:19:48Z")

</div>

If you include the key `%context% : true` in the `data.url` section you can use the Kibana date picker to select your timerange

![image](https://us1.discourse-cdn.com/elastic/original/3X/d/f/df48e9eb52dab4e30aaf5606a8e0e3c1fa6966d3.png)

The other option is to not use `%context%` and `%timefield%` and set up your date filter in the `body`

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/4/e4898b35f62fd02ca7754f85692d20d5e745fe71.png)

---

<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:** [January 25, 2023, 12:20pm UTC](https://discuss.elastic.co/t/make-filter-using-own-data-in-vega-lite/320223/3 "2023-01-25T12:20:27Z")

</div>

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