NUB (_) ~.y selects the nub of y, that is, all of its distinct items. For example:
y ~. y
ABC ABC
ABC DEF
DEF
~.3 $~. 3
3 1
More precisely, the nub is obtained by selecting the leading item, suppressing from the argument all items tolerantly equal to it, selecting the leading remaining item, and so on.