Get union of other fields

Certified Senior Developer

So I have a CDT with a bunch of fields in it. One of the fields is a category, while the other is string. That string field will be identical throughout a particular category, but may or may not be different in different categories. So for example:

local!data: {{category:"round things", string:"bubbles, <otherdata>}, {category:"round things", string:"bubbles, <otherdata>}, {category:"soapy things", string:"bubbles, <otherdata>}, {category:"hard things", string:"rocks, <otherdata>}}

I'd like to get the union of categories for that set, but instead of the output being the categories, it is the strings. 

so something like union(local!data.category, local!data.category) and have the output be: {"bubbles, "bubbles", "rocks"} instead of {"round things", "soapy things", "hard things"}

I hope the idea is clear?

  Discussion posts and replies are publicly visible