Engine Rule node

Hi everyone,

I’m currently working with a dataset containing a list of chemical compounds categorized into three groups: weak, strong, and non. I want to generate a heatmap, but since this column is not numerical, I need to transform it into numbers, e.g. strong = 2, weak = 1, and non = 0. I know I can use the Engine Rule node for that, but I never used that before. It would be great if someone could help me define the rules I need.

Best,
Vanessa

Hi Vanessa,
That is pretty simple. Just use:

$yourcolumn$ = "strong" => 2
$yourcolumn$ = "weak" => 1
$yourcolumn$ = "non" => 0

Replace $yourcolumn$ with the placeholder for your column.
Kind regards,
Alexander

2 Likes

Hi Alexander,

Thanks for your reply. I already tried that, but I got missing values in the end. Do I have to transform the string column into numbers or something?

Cheers,
Vanessa

Hi,
That should not be necessary, but maybe your strings have superfluous spaces or other non-visible characters? You can try this instead:

$yourcolumn$ LIKE "*strong*" => 2
$yourcolumn$ LIKE "*weak*" => 1
$yourcolumn$ LIKE "*non*" => 0

If this does not work, try exporting your table as CSV and check that the values look right. You can also post a screenshot of your table head here so we can check the types.
Kind regards,
Alexander

4 Likes

Or add TRUE => 99 to the rule set to identify records that “different” in some way

$yourcolumn$ = “strong” => 2
$yourcolumn$ = “weak” => 1
$yourcolumn$ = “non” => 0
TRUE => 99

gr. Hans

2 Likes

It worked! Thank you so much.

2 Likes

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