Joining different pairs of value equivalences into "global equivalences"

I would just assume that a reasonable fixed number of recursive iterations should always be sufficient. If that number is rather high (e.g. >10), then a recursive loop can be arranged as described here: How to do recursive loops in EasyMorph.

Each iteration looks up an equivalence group with a lower group number, if it exists. When an equivalence group with a lower group number is found, the original group number is replaced with the lower one. This logic merges equivalence groups into bigger groups.

Note that module “Group” creates an output dataset with exactly the same column names as its input dataset. That allows simply chaining calls to this module one after another.

See the example below.

pairwise-grouping.morph (11.3 KB)

Module “Main”

Module “Group”

2 Likes