# In query editor, add the possibility to use expression as filter

**URL:** <https://community.easymorph.com/t/in-query-editor-add-the-possibility-to-use-expression-as-filter/1927>\
**Category:** Feature requests\
**Created:** [June 19, 2020, 4:03pm UTC](https://community.easymorph.com/t/in-query-editor-add-the-possibility-to-use-expression-as-filter/1927 "2020-06-19T16:03:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![RJO](https://community.easymorph.com/user_avatar/community.easymorph.com/rjo/32/4084_2.png) [@RJO](https://community.easymorph.com/u/RJO)\
**Post date:** [June 19, 2020, 4:03pm UTC](https://community.easymorph.com/t/in-query-editor-add-the-possibility-to-use-expression-as-filter/1927/1 "2020-06-19T16:03:42Z")

</div>

Expressions are considered as columns. But what if it was possible to create our own filters as expressions, it means you can't select it (no checkbox) but you can use it as filter.

So when you drag and drop it in the filter area, no comparison item is proposed, it's just the filter and nothing else.

This would enable to force our own filters. For example when easymorph uses oracle dates, it casts it into timestamp which is not good. So with filter expression we could do MY\_DATE = TO\_DATE(...) without the timestamp cast and without any more comparison to do.

---

<div class="post-metadata">

**Author:** ![RJO](https://community.easymorph.com/user_avatar/community.easymorph.com/rjo/32/4084_2.png) [@RJO](https://community.easymorph.com/u/RJO)\
**Post date:** [June 19, 2020, 5:58pm UTC](https://community.easymorph.com/t/in-query-editor-add-the-possibility-to-use-expression-as-filter/1927/2 "2020-06-19T17:58:27Z")

</div>

Other possible solution : the possibility to deactivate on fields all the possible functions applied by easymorph, which means for example avoid cast on date column, and avoid timestamp on date value (deactivation in both sides of comparison). Or at least this possibility but on date formats only. Could be an option on connector level.

---

<div class="post-metadata">

**Author:** ![andrew.rybka](https://community.easymorph.com/user_avatar/community.easymorph.com/andrew.rybka/32/13_2.png) [@andrew.rybka](https://community.easymorph.com/u/andrew.rybka)\
**Post date:** [June 19, 2020, 6:20pm UTC](https://community.easymorph.com/t/in-query-editor-add-the-possibility-to-use-expression-as-filter/1927/3 "2020-06-19T18:20:02Z")

</div>

Hi Romain,

As a temporary workaround you can create an expression like the following:

`CASE WHEN MY_DATE = TO_DATE(…) THEN 1 ELSE 0 END`

and then filter the expression.

As a more user-friendly solution we were thinking about adding something like a "Custom" condition:

 ![image](https://community.easymorph.com/uploads/default/original/2X/c/ca05cebf47ef04c09a4cfb6f442ab3d6c5146da8.png)

What do you think about this approach?

---

<div class="post-metadata">

**Author:** ![RJO](https://community.easymorph.com/user_avatar/community.easymorph.com/rjo/32/4084_2.png) [@RJO](https://community.easymorph.com/u/RJO)\
**Post date:** [June 20, 2020, 8:58am UTC](https://community.easymorph.com/t/in-query-editor-add-the-possibility-to-use-expression-as-filter/1927/4 "2020-06-20T08:58:18Z")

</div>

I tried the « case when » but it’s failing the query plan too. The custom filter is a very good idea.

---

<div class="post-metadata">

**Author:** ![RJO](https://community.easymorph.com/user_avatar/community.easymorph.com/rjo/32/4084_2.png) [@RJO](https://community.easymorph.com/u/RJO)\
**Post date:** [November 3, 2020, 9:42am UTC](https://community.easymorph.com/t/in-query-editor-add-the-possibility-to-use-expression-as-filter/1927/5 "2020-11-03T09:42:52Z")

</div>

Hi Andrew, can you confirm this feature is planned for next version or for future version ? I mean we would prefer not having this timestamp function that is highly decreasing performance but Custom is a nice way to bypass this.

It is also a way for users to do what they want by typing simple code. It's very important that Custom SQL can handle parameters as it is described in my previous post (screenshot).

I'm surprised no one spotted this among oracle users. As soon as you have oracle table with date field as key, performance are really bad with timestamp function, as generated by Easymorph query editor.

---

<div class="post-metadata">

**Author:** ![dgudkov](https://community.easymorph.com/user_avatar/community.easymorph.com/dgudkov/32/5_2.png) [@dgudkov](https://community.easymorph.com/u/dgudkov)\
**Post date:** [November 3, 2020, 10:55am UTC](https://community.easymorph.com/t/in-query-editor-add-the-possibility-to-use-expression-as-filter/1927/6 "2020-11-03T10:55:13Z")

</div>

Hi Romain,

I confirm that the custom condition is planned for release in v4.6.
