if/then table joiner

sorry i don’t have dummy data! but here’s the relation i need to find, i hope it’s clear enough! from left to right
unit to clusters using k-means
k-means cluster means
k-means cluster as units to AHC clusters