Search, remove, and shift

Here is how I understood the logic:

Fee,Code,Multiplicator,Minimum represent a unit of information. Basically the structure of table is as follows:

image

When one unit is removed (e.g. Unit2), the units to the right of it move left. It would be easier to deal with if we straighten the table:

image

Now, instead of moving units leftward, they will move upward. But wait, this is just regular filtering! So let’s mark the units to be removed, and then split them into two different tables:

image

Now we just need to unpivot the units back:
image

All this can be done in EasyMorph. Here is a project that does exactly that:

raskarov.morph (15.3 KB)

Gotchas:

  • To preserve column order in the result tables I use the feature of the “Append” action to preserve the column order of the table to which the other table is appended.
  • Before the very first unpivoting, I enumerated rows to make sure each row has a unique ID that doesn’t depend on other columns’ values, so unpivoting won’t accidentally deduplicate rows.