# Create month on month comparison bar chart over 2 year period - can't use scripted field in timelion

**URL:** https://discuss.elastic.co/t/create-month-on-month-comparison-bar-chart-over-2-year-period-cant-use-scripted-field-in-timelion/254052
**Category:** Kibana
**Tags:** timelion
**Created:** [November 2, 2020, 4:39pm UTC](https://discuss.elastic.co/t/create-month-on-month-comparison-bar-chart-over-2-year-period-cant-use-scripted-field-in-timelion/254052 "2020-11-02T16:39:18Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![alibe](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@alibe](https://discuss.elastic.co/u/alibe)
#### Post date: [November 2, 2020, 4:39pm UTC](https://discuss.elastic.co/t/create-month-on-month-comparison-bar-chart-over-2-year-period-cant-use-scripted-field-in-timelion/254052/1 "2020-11-02T16:39:18Z")

</div>

I'm trying to build a visualisation to compare month v month over a 2 year period, incl some lucene to filter my results.  
I can add the lucene in timelion, but can't add a scripted field query to filter down my results. I get 0 results. I can add the filter using a non-scripted field to filter.

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [November 3, 2020, 8:08am UTC](https://discuss.elastic.co/t/create-month-on-month-comparison-bar-chart-over-2-year-period-cant-use-scripted-field-in-timelion/254052/2 "2020-11-03T08:08:59Z")

</div>

You can't use scripted fields within lucene, but if you set the query bar above the visualization to KQL, you can use scripted fields there and they will be applied to all series in your chart.

---

<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: [December 1, 2020, 8:09am UTC](https://discuss.elastic.co/t/create-month-on-month-comparison-bar-chart-over-2-year-period-cant-use-scripted-field-in-timelion/254052/3 "2020-12-01T08:09:05Z")

</div>

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