Good Morning
I have the following dataset:
And I try to reach this output:
- key: only one row per key
- text: join all texts of the rows with the same key (but no duplicates)
- min: take the lowest value (but not empty) of the rows with the same key
- max: take the highest value (but not empty) of the rows with the same key
I used dataInput[GroupBy[{#key} &]]
but then I got stuck.
I tried to apply Union
,Max
and Min
for individual rows but somehow I don't manage to generalize it.
Other attempts:
dataInput[GroupBy[#key &], MaximalBy[#max &]&&MinimalBy[#min&] // Values // Flatten
Query[GroupBy["key"], Catenate, "text"] @ dataInput
JoinAcross[dataInput, Key[key], "Inner", KeyCollisionFunction -> Function[x, Max[x]]]