# Timelion Visualization dropdown to edit comparison

**URL:** <https://discuss.elastic.co/t/timelion-visualization-dropdown-to-edit-comparison/255303>\
**Category:** Kibana\
**Tags:** timelion\
**Created:** [November 13, 2020, 8:03am UTC](https://discuss.elastic.co/t/timelion-visualization-dropdown-to-edit-comparison/255303 "2020-11-13T08:03:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nagabhushan.tr](https://avatars.discourse-cdn.com/v4/letter/n/7ea924/32.png) [@nagabhushan.tr](https://discuss.elastic.co/u/nagabhushan.tr)\
**Post date:** [November 13, 2020, 8:03am UTC](https://discuss.elastic.co/t/timelion-visualization-dropdown-to-edit-comparison/255303/1 "2020-11-13T08:03:28Z")

</div>

Hi,

We are building interactive visualization to compare the sales data over timelion, ask is to compare the sales today to yesterday(this duration should be customizable), which i am able to achieve by having a offset on the timelion expression something like below. I want the offset to be dynamic. Do we have an option to build this with the help of drop down, something like when i choose 1 week, actual and the offset duration change to 1 week without having to choose the expression manually.

es(index=logs\*, metric=cardinality:sales.id).label('Sales Current'), .es(index=logs\*, metric=cardinality:sales.id, offset=-1d).label('Sales Yesterday')

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [November 26, 2020, 11:08am UTC](https://discuss.elastic.co/t/timelion-visualization-dropdown-to-edit-comparison/255303/2 "2020-11-26T11:08:49Z")

</div>

Hi @nagabhushan.tr

Using Timelion directly is not achievable. What you can do is to use Canvas to add a dropdown filter with a simple table (using the `csv` function expression with a set of key, value rows like: `last week,-1w`) to create a filter and then add a line chart with the mentioned timelion query including the selected value from the dropdown in the offset parameter

---

<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 24, 2020, 11:08am UTC](https://discuss.elastic.co/t/timelion-visualization-dropdown-to-edit-comparison/255303/3 "2020-12-24T11:08:50Z")

</div>

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