Rule engine (dictionary)

Hello guys,

I have one question regarding to Rule engine (dictionary).

I use simple Rule engine to mapped data volume to number during some normalization process. Example bellow:
Here is illustrated data volume KiB normalization and it works pretty well. The problem is it works only for one column. How can I specify I wanna mapped column $split_4$ $split_6$ $split_8$ as well? I was thinking about Rule engine (dictionary), but I am not pretty sure if this could work.

image

Thank you for a help!

You’d have to use an additional node for every new column you want added/modified.

If you want to do something like this with 1 node, you can try nesting a series of if-else statements in the Column Expressions node.

1 Like

Hi @sm0lda

Another approach is to have the Rule Engine within a Column List Loop. See this workflow rule_engine_multi_column.knwf (32.0 KB)


gr. Hans

1 Like

thanks for ideas, but I have four columns in my case and I tried to avoid to use four times rule engine node. In your case I have to use more than four nodes (loop start, regex, rule engine, regex, loop end etc.) so it seems like I have to use my solution. Or does anyone have any idea how to simplify it?

Even totally different approach with this normalization?

Thanks a lot

Hi @sm0lda,

For such cases following approach is mostly ok:

  1. use Unpivoting node to have all columns in one column
  2. apply rules
  3. use Pivoting pivoting to have your original table structure

Check this example from Hub: https://kni.me/w/oPOxSV3Hwrd3wVnR

Rule Engine (Dictionary) works only on a single column.

Br,
Ivan

2 Likes

all right, i’ll try it. Thank you

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