# Rule Engine Column string NOT LIKE

**URL:** <https://forum.knime.com/t/rule-engine-column-string-not-like/60688>\
**Category:** KNIME Extensions\
**Tags:** text-processing\
**Created:** [January 30, 2023, 12:51pm UTC](https://forum.knime.com/t/rule-engine-column-string-not-like/60688 "2023-01-30T12:51:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gem4236](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/g/5f8ce5/32.png) [@gem4236](https://forum.knime.com/u/gem4236)\
**Post date:** [January 30, 2023, 12:51pm UTC](https://forum.knime.com/t/rule-engine-column-string-not-like/60688/1 "2023-01-30T12:51:42Z")

</div>

Hi,

I’m trying to create a rule for rule engine which searches a combined string for a particular value for a data set is quite messy in terms of string content .

for example: combined string row - “28000, male, employed at twitter”  
rule: $combined string$ LIKE “employed”

to search for employed people

is it possible to create a rule with NOT LIKE i.e. NOT $combined string$ LIKE “employed”

to exclude rows where this word appears?

---

<div class="post-metadata">

**Author:** ![Andrew\_Steel](https://forum-cdn.knime.com/user_avatar/forum.knime.com/andrew_steel/32/4472_2.png) [@Andrew\_Steel](https://forum.knime.com/u/Andrew_Steel)\
**Post date:** [January 30, 2023, 1:36pm UTC](https://forum.knime.com/t/rule-engine-column-string-not-like/60688/2 "2023-01-30T13:36:28Z")

</div>

Hi @gem4236,

to exclude rows you could use a `Row Filter` Node.

 ![Bildschirmfoto vom 2023-01-30 14-33-57](https://forum-cdn.knime.com/uploads/default/original/3X/d/1/d1f1cd8790cac0a45c7e0b92e68f0d5c391a193d.png)

Best Regards  
Andrew

---

<div class="post-metadata">

**Author:** ![gem4236](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/g/5f8ce5/32.png) [@gem4236](https://forum.knime.com/u/gem4236)\
**Post date:** [January 30, 2023, 1:58pm UTC](https://forum.knime.com/t/rule-engine-column-string-not-like/60688/3 "2023-01-30T13:58:09Z")

</div>

Hi Andrew,

Thank you for your reply! Much appreciated.

I’m using a Rule Engine Dictionary on multiple healthcare data sets, which is why i’m using rules. As they will change depending on what set i’m working on.

In this case i want to add a rule to exclude a condition, additionally to a set of rules already being applied.

Hope this makes sense

---

<div class="post-metadata">

**Author:** ![Andrew\_Steel](https://forum-cdn.knime.com/user_avatar/forum.knime.com/andrew_steel/32/4472_2.png) [@Andrew\_Steel](https://forum.knime.com/u/Andrew_Steel)\
**Post date:** [January 30, 2023, 2:13pm UTC](https://forum.knime.com/t/rule-engine-column-string-not-like/60688/4 "2023-01-30T14:13:53Z")

</div>

Hi @gem4236,

the `Row Filter` can also be provided with a dictionary. It is called `Rule-based Row Filter (Dictionary)`. If you want to use the filtered records further, a `Rule-based Row Splitter (Dictionary)` could also be useful.

I hope it helps.

Andrew

---

<div class="post-metadata">

**Author:** ![DiaAzul](https://forum-cdn.knime.com/user_avatar/forum.knime.com/diaazul/32/48297_2.png) [@DiaAzul](https://forum.knime.com/u/DiaAzul)\
**Post date:** [January 30, 2023, 2:26pm UTC](https://forum.knime.com/t/rule-engine-column-string-not-like/60688/5 "2023-01-30T14:26:17Z")

</div>

@gem4236

You need to include the wildcard characters in your string to get an inexact match e.g `"*employed*" to match `“is employed at work”`. Usual wildcard characters apply `?\*`.

To invert the match you can, as you suggest, use the `NOT` clause. I tested `NOT` both with and without brackets around the main clause and it appears that `LIKE` is higher precedence than `NOT`. In practice, I always put brackets around terms to ensure that processing is explicit e.g. `NOT ($column1$ LIKE "*employee*") => TRUE`. This prevents any risk that the computer processes operators in a different sequence from the one I intended.

DiaAzul  
[LinkedIn](https://www.linkedin.com/in/david-plummer-ab41791/) | [Medium](https://medium.com/@DiaAzul) | [GitHub](https://github.com/DiaAzul)

---

<div class="post-metadata">

**Author:** ![gem4236](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/g/5f8ce5/32.png) [@gem4236](https://forum.knime.com/u/gem4236)\
**Post date:** [January 30, 2023, 2:29pm UTC](https://forum.knime.com/t/rule-engine-column-string-not-like/60688/6 "2023-01-30T14:29:58Z")

</div>

Thank you, will definitely look into this

---

<div class="post-metadata">

**Author:** ![gem4236](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/g/5f8ce5/32.png) [@gem4236](https://forum.knime.com/u/gem4236)\
**Post date:** [January 30, 2023, 2:31pm UTC](https://forum.knime.com/t/rule-engine-column-string-not-like/60688/7 "2023-01-30T14:31:09Z")

</div>

Thank you! would of took me a long time to figure this out

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [February 6, 2023, 2:31pm UTC](https://forum.knime.com/t/rule-engine-column-string-not-like/60688/8 "2023-02-06T14:31:12Z")

</div>

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