GroupRank lets you group rows by the values in one column (group by) and then rank the rows within that group according to another column (rank by) across a window defined by you.
To implement a GroupRank operation:
- Enter a name for the column that will display length
- Select a column that StreamLab will use to group rows over the group window.
- Select a column that StreamLab will use to rank rows within the group defined above.
- Select an operation to aggregate values within the group. See Operations Used in Commands for more details on these operations.
- Select a length and unit for the group window, such as “1 hour” or “15 minutes”.
- Chose to sort group rows in either ascending or descending order.
- Choose to order output rows in either ascending or descending order.
- Choose rolling or tumbling window type. See below for more information on these.
- If desired, define a max idle time for holding a group for ranking. When maxIdle expires the current group is released to the stream. A value of zero indicates no idle time out.
- If desired, indicate the maximum number of rows the UDX will output in a given group. A value of 0 indicates no limit.
- Click the + icon to add the command to the Guide script.
The results of the script appear in the Output View window.