Assigning colours by column substring

I’m trying to assign columns to colours based on a dictionary of column name substrings, for example: Columns whose name contains “XR” should be black, columns whose name contains “Ludwig” should be red, etc.

The task has proven impossible. Can anyone demonstrate how it can be done?

Many thanks!

Solution found, please ignore

Good to hear that you figured it out! Would you mind sharing the solution?

It goes a bit against the spirit of this community, sharing problems and solutions so that fellow KNIME’ers can also benefit from this :wink: I’m sure you used other existing topic as well so find solutions in different scenarios.

2 Likes

Of course. The solution involves the following steps:

  1. To the table resulting from using the node Column Headings, add a column “Substrings” with substrings as values (ie, “XR”, “Ludwig” etc.)
  2. Use the Table Manipulator to move the full strings column first/leftmost
  3. Feed the column headings and substrings table to the Color Manager to assign colours to the substrings, eg “XR” is black etc.

Cheers

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