First and Last for Group

For a given group column, appends two boolean columns IS_FIRST_IN_GROUP and IS_LAST_IN_GROUP which mark the first and the last row in the current sorted order for the data if grouped by the given column.

If grouping by more than one column is required, then you must first create a new column containing the "composite key" of the concatenated other columns and then use this as the grouping column.

If you need to find the first or last "significant" row for a given column (e.g. the last non-zero value), then create a composite key column a column expression that only creates group values for the non-zero rows


May 5th 2021 @takbb Brian Bates

Options

Choose Grouping Column
Enter a column that represents the identifier for a group. If a group identifier requires multiple columns, create a new column which joins together the values of all the other identifying columns prior to calling this node
Name of output column for FIRST_IN_GROUP
Enter the name to be given to the output boolean column used to mark FIRST_IN_GROUP
Name of output column for LAST_IN_GROUP
Enter the name to be given to the output boolean column used to mark LAST_IN_GROUP

Input Ports

Icon
Data, already sorted into the required order for processing by group

Output Ports

Icon
Data as supplied but with additional boolean columns FIRST_IN_GROUP and LAST_IN_GROUP

Nodes

Extensions

Links