Canvas Time filter breaks other elements

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.

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.

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

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.?

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

filters "myFilter"
| ...

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?

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?

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

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

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

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.

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.

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.

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

:+1: Thanks for your help anyway, the group filter was a good shout.

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