Summary: This post explains how to use DQL to summarize multiple array elements by picking the maximum value for each matching key. It provides example queries and discusses data‑structuring considerations.
I have a dataset of 1000+ hosts, each with a fixed-sized array of 120+ numeric values. Most hosts have only one entry, but a few can have multiple rows. I want to summarize those, per host, with the maximum value of each element within the array. Which is the best (most economical) way to do this in DQL?
Example extract:
| host | data |
|---|---|
| host_A | (3,8,6) |
| host_A | (5,0,7) |
| host_B | (1,7,3) |
| host_B | (4,6,2) |
| host_B | (8,5,2) |
| host_C | (5,3,9) |
| host_D | (4,5,6) |
Desired outcome:
| host | result |
|---|---|
| host_A | (5,8,7) |
| host_B | (8,7,3) |
| host_C | (5,3,9) |
| host_D | (4,5,6) |
I was looking into ‘dedup’, summarize, and max() , takeMax, functions, but didn’t get any further than filtering on the entry with the highest first element of the array, per host