# Canvas Time filter breaks other elements

**URL:** <https://discuss.elastic.co/t/canvas-time-filter-breaks-other-elements/251754>\
**Category:** Kibana\
**Created:** [October 12, 2020, 11:02am UTC](https://discuss.elastic.co/t/canvas-time-filter-breaks-other-elements/251754 "2020-10-12T11:02:24Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![GavinBeattie](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@GavinBeattie](https://discuss.elastic.co/u/GavinBeattie)\
**Post date:** [October 12, 2020, 11:02am UTC](https://discuss.elastic.co/t/canvas-time-filter-breaks-other-elements/251754/1 "2020-10-12T11:02:25Z")

</div>

I am trying to add a Time filter element to a Canvas Workpad, but each time I do it breaks the existing table or chart elements.

I think that I have followed all online guidance/tutorials to the letter e.g.

> **[Using Metric and Markdown Elements in Canvas within Kibana](https://www.elastic.co/blog/kibana-canvas-metric-and-markdown-elements)**
>
> Learn how to work with the Metric and Markdown elements in Canvas, using a sample data set built-in to Elasticsearch and Kibana.

  

> **[Tutorial: Create a workpad for monitoring sales | Kibana Guide \[7.9\] | Elastic](https://www.elastic.co/guide/en/kibana/current/canvas-tutorial.html)**

Both are quite clear. Set up table with SQL (the SQL query works fine in table, co-ord plot, debug data, etc.). As soon as Add element \> Filter \> Time Filter is selected the following error appears:

* * *

Whoops! Expression failed  
Expression failed with the message:  
[essql] \> Unexpected error from Elasticsearch: [verification\_exception] Found 1 problem line 1:30: Unknown index [my\_index]

* * *

I haven’t even changed the settings of the filter column at this point. Once changed to our time field startDate, the error is unchanged. The index pattern is available and works fine until the time filter is added.

The dropdown select filter works perfectly and as expected. startDate is type of date, so should work with the time filter (fine in Discovery too). Therefore, I can only conclude that it is a bug. There is nothing else in config to control the behaviour, unless I'm missing something fundamental.

---

<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:** [October 12, 2020, 11:25pm UTC](https://discuss.elastic.co/t/canvas-time-filter-breaks-other-elements/251754/2 "2020-10-12T23:25:37Z")

</div>

I encountered this issue as well.  
Try using time filters in all your visualisations.

---

<div class="post-metadata">

**Author:** ![GavinBeattie](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@GavinBeattie](https://discuss.elastic.co/u/GavinBeattie)\
**Post date:** [October 13, 2020, 6:27am UTC](https://discuss.elastic.co/t/canvas-time-filter-breaks-other-elements/251754/3 "2020-10-13T06:27:37Z")

</div>

Do you mean all elements that are visualisations, or something else please? I have tried with just a single element on my Canvas Workpad and got the same error. Is there a step I'm missing to use the Time Filter with the elements tables, charts, etc.?

---

<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:** [October 13, 2020, 7:08am UTC](https://discuss.elastic.co/t/canvas-time-filter-breaks-other-elements/251754/4 "2020-10-13T07:08:36Z")

</div>

In the expression you need to add the filter element at the top

```auto
filters "myFilter"
| ...

```

---

<div class="post-metadata">

**Author:** ![GavinBeattie](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@GavinBeattie](https://discuss.elastic.co/u/GavinBeattie)\
**Post date:** [October 13, 2020, 7:15am UTC](https://discuss.elastic.co/t/canvas-time-filter-breaks-other-elements/251754/5 "2020-10-13T07:15:51Z")

</div>

I think that is for filter groups, but I've added anyway. I now have 2 identical elements with 'filter "group1" | ...' and a 'filter "group2" | ...'. Unfortunately, now when I select the filter group from the Time filter it breaks the [element/group] I select. The other element appears normally but unfiltered.

Does the SQL query need linked to the filter? I took from the demo it just needs the field name.

The date/time field is the same name in multiple indices, could this be an issue?

---

<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:** [October 13, 2020, 10:31pm UTC](https://discuss.elastic.co/t/canvas-time-filter-breaks-other-elements/251754/6 "2020-10-13T22:31:54Z")

</div>

Sorry, I am not following.  
Try having 1 filter and 1 element in the workpad.  
Don't forget to configure the filter in the elements code.  
Does that work?

---

<div class="post-metadata">

**Author:** ![GavinBeattie](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@GavinBeattie](https://discuss.elastic.co/u/GavinBeattie)\
**Post date:** [October 14, 2020, 7:44am UTC](https://discuss.elastic.co/t/canvas-time-filter-breaks-other-elements/251754/7 "2020-10-14T07:44:44Z")

</div>

This is my element - am I missing something to use the time filter values in the query?

```auto
filters "myGroup"
| essql query="SELECT COUNT(*) as test FROM \"myIndex\""
| math "size(test)"
| metric "Countries" 
  metricFont={...} 
  labelFont={...} metricFormat="0,0.[000]"
| render
```

---

<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:** [October 14, 2020, 10:45pm UTC](https://discuss.elastic.co/t/canvas-time-filter-breaks-other-elements/251754/8 "2020-10-14T22:45:32Z")

</div>

Looks correct to me.  
What breaks then? Can you share a screenshot?

---

<div class="post-metadata">

**Author:** ![GavinBeattie](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@GavinBeattie](https://discuss.elastic.co/u/GavinBeattie)\
**Post date:** [October 16, 2020, 7:55am UTC](https://discuss.elastic.co/t/canvas-time-filter-breaks-other-elements/251754/9 "2020-10-16T07:55:34Z")

</div>

![Screenshot 2020-10-16 at 08.51.29](https://us1.discourse-cdn.com/elastic/original/3X/d/9/d9c6d6a7b104150b64f5a395cf71d43896c247a8.png)

Please see screenshot. I have tried a number of indices and behaviour is always same. It just can't seem to apply the time filter to the data when applied via the column.

---

<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:** [October 19, 2020, 2:50am UTC](https://discuss.elastic.co/t/canvas-time-filter-breaks-other-elements/251754/10 "2020-10-19T02:50:45Z")

</div>

Not sure what's going on.  
Everything seems to be in place.  
I am using 7.9.1 and did not encounter any issues as described.

---

<div class="post-metadata">

**Author:** ![GavinBeattie](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@GavinBeattie](https://discuss.elastic.co/u/GavinBeattie)\
**Post date:** [October 19, 2020, 5:12pm UTC](https://discuss.elastic.co/t/canvas-time-filter-breaks-other-elements/251754/11 "2020-10-19T17:12:27Z")

</div>

I'm on 7.9.2 and I've also tried another deployment from scratch with just a 10 record index. I don't get the error message, but the time filter behaviour overall isn't fit for purpose. Changing the time forwards the refresh sometimes works, backwards needs the refresh to be triggered by toggling edit or full screen. It would be much better to include the Refresh button (like Discover) in the control.

---

<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:** [October 19, 2020, 10:12pm UTC](https://discuss.elastic.co/t/canvas-time-filter-breaks-other-elements/251754/12 "2020-10-19T22:12:21Z")

</div>

My experience shows that, overall canvas is buggy.  
Sorry mate. Hope you find a solution.

---

<div class="post-metadata">

**Author:** ![GavinBeattie](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@GavinBeattie](https://discuss.elastic.co/u/GavinBeattie)\
**Post date:** [October 20, 2020, 2:59pm UTC](https://discuss.elastic.co/t/canvas-time-filter-breaks-other-elements/251754/13 "2020-10-20T14:59:47Z")

</div>

👍 Thanks for your help anyway, the group filter was a good shout.

---

<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:** [November 17, 2020, 2:59pm UTC](https://discuss.elastic.co/t/canvas-time-filter-breaks-other-elements/251754/14 "2020-11-17T14:59:47Z")

</div>

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