# Time filter is not working

**URL:** <https://discuss.elastic.co/t/time-filter-is-not-working/258000>\
**Category:** Kibana\
**Tags:** elastic-stack-sql\
**Created:** [December 8, 2020, 1:39pm UTC](https://discuss.elastic.co/t/time-filter-is-not-working/258000 "2020-12-08T13:39:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Treki](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@Treki](https://discuss.elastic.co/u/Treki)\
**Post date:** [December 8, 2020, 1:39pm UTC](https://discuss.elastic.co/t/time-filter-is-not-working/258000/1 "2020-12-08T13:39:26Z")

</div>

Hello,

this is our Canvas workpad:

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

As you can see time filter on top of the page does not work correctly regarding the elements presented in the data table.

This is the expression of the time filter:  
 ![timetable_expression](https://us1.discourse-cdn.com/elastic/original/3X/3/a/3a4748351e384749ac103bcb5e4bd14db7798e39.png)

This is the expression of **both** data tables:  
 ![expression_syntax](https://us1.discourse-cdn.com/elastic/original/3X/e/5/e59f9146a42c91b77fa82150cc093a0bc30d7584.png)

Can it be that the time-stamp pattern is not correctly recognised?  
We can order the rows according to the timespan in the Discover view:

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

What can we do so that the data tables are working correctly according to the chosen time span?  
Moreover, I would like to know if the Canvas view is refreshing automatically when changing the time filter element.

Let's say that we want to delete the time filter element.  
However, we still want to present the correct elements for the timespan between 2020-01-20 and 2020-01-31 in the data tables.  
How do we need to edit the code in the expression editor?

With best regards

---

<div class="post-metadata">

**Author:** ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)\
**Post date:** [December 10, 2020, 4:08am UTC](https://discuss.elastic.co/t/time-filter-is-not-working/258000/2 "2020-12-10T04:08:23Z")

</div>

You might have a syntax issue in the expression of the time filter?  
`colulmn="\@timstamp\"`  
Why the duplicate quotes?

Also, there is a bug with sorting, but with other visualisation than tables.  
Can you sort it in the dashboard feature?

Bug - [https://github.com/elastic/kibana/issues/62770#issuecomment-713733516](https://github.com/elastic/kibana/issues/62770#issuecomment-713733516)

---

<div class="post-metadata">

**Author:** ![Treki](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@Treki](https://discuss.elastic.co/u/Treki)\
**Post date:** [December 10, 2020, 7:48am UTC](https://discuss.elastic.co/t/time-filter-is-not-working/258000/3 "2020-12-10T07:48:35Z")

</div>

You are right!  
There was a syntax issue in the expression of the time filter.  
I fixed it. Still, the problem is present.

In order to better explain what is going on, I recorded a [video](https://streamable.com/7wymow).

The data table does not automatically update when I change the time range.  
The data tables update when I click on the "eye" symbol.  
Is there a way how the tables automatically update when I change the time range?

Moreover, I would like to ask what I need to write in the expression editor of the data tables in order to filter the data tables between two given dates when I delete the time filter element?

---

<div class="post-metadata">

**Author:** ![Treki](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@Treki](https://discuss.elastic.co/u/Treki)\
**Post date:** [December 15, 2020, 11:18am UTC](https://discuss.elastic.co/t/time-filter-is-not-working/258000/4 "2020-12-15T11:18:29Z")

</div>

@AClerk

could you respond to my answer, please?

---

<div class="post-metadata">

**Author:** ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)\
**Post date:** [December 16, 2020, 3:43am UTC](https://discuss.elastic.co/t/time-filter-is-not-working/258000/5 "2020-12-16T03:43:11Z")

</div>

@Treki  
Not sure what you are trying to achieve.  
The filters are not meant to be changed frequently.  
If you want the user to interact with the filters, try creating a data table in the visualization feature and then import it to Canvas. You will have a user filter

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

In the ESQL statement you can add a where clause and date conditions.

```auto
Select
 ...
...
Where date >= <DATE> and date < <DATE>

```

You can also use NOW(), INTERVAL, etc.

> **[Date/Time and Interval Functions and Operators | Elasticsearch Reference...](https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-functions-datetime.html)**

---

<div class="post-metadata">

**Author:** ![Treki](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@Treki](https://discuss.elastic.co/u/Treki)\
**Post date:** [December 16, 2020, 9:35am UTC](https://discuss.elastic.co/t/time-filter-is-not-working/258000/6 "2020-12-16T09:35:21Z")

</div>

@AClerk

Thank you for your answer!

Have you watched the video?  
The data table has not updated itself after I changed the timespan.  
An update only occurs after I clicked on the "eye" symbol.  
Is this a bug?

---

<div class="post-metadata">

**Author:** ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)\
**Post date:** [December 16, 2020, 10:58pm UTC](https://discuss.elastic.co/t/time-filter-is-not-working/258000/7 "2020-12-16T22:58:09Z")

</div>

Not sure.  
Might be a bug.  
Need to ask an Elastic team member.  
Cheers

---

<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 13, 2021, 10:58pm UTC](https://discuss.elastic.co/t/time-filter-is-not-working/258000/8 "2021-01-13T22:58:13Z")

</div>

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