# Timelion- assign a time series to a variable and then refer to it using that variable

**URL:** <https://discuss.elastic.co/t/timelion-assign-a-time-series-to-a-variable-and-then-refer-to-it-using-that-variable/111086>\
**Category:** Kibana\
**Created:** [December 11, 2017, 12:36pm UTC](https://discuss.elastic.co/t/timelion-assign-a-time-series-to-a-variable-and-then-refer-to-it-using-that-variable/111086 "2017-12-11T12:36:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![emil.mirzayev](https://avatars.discourse-cdn.com/v4/letter/e/ba9def/32.png) [@emil.mirzayev](https://discuss.elastic.co/u/emil.mirzayev)\
**Post date:** [December 11, 2017, 12:36pm UTC](https://discuss.elastic.co/t/timelion-assign-a-time-series-to-a-variable-and-then-refer-to-it-using-that-variable/111086/1 "2017-12-11T12:36:31Z")

</div>

Hey there! I am creating time-series forecast using holt() and other functions. The thing is, my conditions and query are too long and for every function I have to add the same time-series as an arguments again. Is it possible to declare a variable which contains the desired time series and then inside the functions to refer to that variable? What i want to do, looks like this:  
`a = .es(indexname, metric, timefield, splitting_condition), a.if(some if function body), a.trend(), a.holt()` and etc..

---

<div class="post-metadata">

**Author:** ![Stacey\_Gammon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stacey_gammon/32/14025_2.png) [@Stacey\_Gammon](https://discuss.elastic.co/u/Stacey_Gammon)\
**Post date:** [December 11, 2017, 8:39pm UTC](https://discuss.elastic.co/t/timelion-assign-a-time-series-to-a-variable-and-then-refer-to-it-using-that-variable/111086/2 "2017-12-11T20:39:10Z")

</div>

I don't believe that is currently possible, but it sounds useful. I encourage you to file a feature request here [https://github.com/elastic/kibana/issues](https://github.com/elastic/kibana/issues).

---

<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 8, 2018, 8:44pm UTC](https://discuss.elastic.co/t/timelion-assign-a-time-series-to-a-variable-and-then-refer-to-it-using-that-variable/111086/3 "2018-01-08T20:44:20Z")

</div>

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