# How to dislink time picker and X-axis of Lens

**URL:** https://discuss.elastic.co/t/how-to-dislink-time-picker-and-x-axis-of-lens/306089
**Category:** Kibana
**Tags:** lens
**Created:** [June 1, 2022, 8:12am UTC](https://discuss.elastic.co/t/how-to-dislink-time-picker-and-x-axis-of-lens/306089 "2022-06-01T08:12:17Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)
#### Post date: [June 1, 2022, 8:12am UTC](https://discuss.elastic.co/t/how-to-dislink-time-picker-and-x-axis-of-lens/306089/1 "2022-06-01T08:12:17Z")

</div>

I have a trouble with when I want to select documents from an index pattern by their `Time field` using time picker and visualize a date histogram on another datetime field.

1. I created an index and an index pattern with Time field on `CREATE_DATE`.

```auto
PUT test_two_date_fields
{
  "mappings": {
    "properties": {
      "CREATE_DATE":{"type":"date"},
      "UPDATE_DATE":{"type":"date"},
      "TYPE": {"type": "keyword"}
    }
  }
}

POST test_two_date_fields/_doc
{
  "CREATE_DATE": "2022-05-01",
  "UPDATE_DATE": "2022-06-01",
  "TYPE": "A"
}

POST test_two_date_fields/_doc
{
  "CREATE_DATE": "2022-05-02",
  "UPDATE_DATE": "2022-05-02",
  "TYPE": "A"
}

POST test_two_date_fields/_doc
{
  "CREATE_DATE": "2022-05-03",
  "UPDATE_DATE": "2022-05-04",
  "TYPE": "B"
}

```

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

1. First, when using Discover, of course time picker filter documents by the `Time field` (here: `CREATE_DATE`) of the index pattern.  

2. Using Lens, if I want to visualize a date histogram for `UPDATE_DATE` with filtering by the `Time field` ( `CREATE_DATE`) using time\_picker, I get the time picker applied not on `Time field` but on the plot's X-axis: `UPDATE_DATE`.  

3. With "Aggregation based", even if a Date Histogram of a datetime field is set on X-axis buckets, the time-picker filters the documents by the `Time field` of the index pattern. The range of the x-axis is automatically fit to the min/max of the field.  

The behavior between 2. and 3. is not consistent and I feel it a little strange that the time picker works for filtering on X-axis just when the X-axis is a datetime field. The group of documents will be different between multiple visualizations on a single dashboard. Is there any option to dislink time picker and X-axis of Lens?

---

<div class="post-metadata">

### Author: ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)
#### Post date: [June 1, 2022, 8:22am UTC](https://discuss.elastic.co/t/how-to-dislink-time-picker-and-x-axis-of-lens/306089/2 "2022-06-01T08:22:55Z")

</div>

Hi @Tomo_M

this feature has been added in Lens since 8.2.0: [[Lens] Allow detaching from global time range by flash1293 · Pull Request #125563 · elastic/kibana · GitHub](https://github.com/elastic/kibana/pull/125563)

---

<div class="post-metadata">

### Author: ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)
#### Post date: [June 1, 2022, 8:28am UTC](https://discuss.elastic.co/t/how-to-dislink-time-picker-and-x-axis-of-lens/306089/3 "2022-06-01T08:28:20Z")

</div>

Thank you @Marco_Liberati !  
That feature is just I needed.  
I'm planning to update. Thanks 😀

---

<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 29, 2022, 8:28am UTC](https://discuss.elastic.co/t/how-to-dislink-time-picker-and-x-axis-of-lens/306089/4 "2022-06-29T08:28:33Z")

</div>

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