Grouping Data
The following example uses a Group Filter element to group the data in the datalayer on a specific column:
- As shown above, a Group Filter element is added as a child of the datalayer element.
- Its Group Column attribute is set to the name of a column in the datalayer. The data will be grouped based on the values in this column.
- Its Data Type column is set to the data type of the column named in the Group Column attribute. This ensures unambiguous ordering of the data and, though optional, setting it is recommended.
- Its Keep Grouped Rows attribute is set to True to ensure that all grouped rows are retained in the datalayer. This is necessary if you're going to aggregate the grouped rows. If you want to work with unique rows, leave this attribute blank (see below).
The resulting output is shown above. The rows are grouped by CategoryID and all rows for each category are included. Other optional Group Filter attributes include:
- Hierarchical - Groups the rows into a hierarchical structure. See Hierarchical Data for more details.
- Include Condition - Specifies whether grouping will occur when the report runs. If left blank or if it contains an expression that evaluates to True, grouping will occur. If it evaluates to False, the element is ignored and grouping will not occur. More than one group filter can be put under any level, specified by the attribute "IncludeCondition" for each group filter.
- Sort Sequence allows you to control the way in which grouped rows are sorted. The default (blank) value causes Ascending order to be used, but you can change the value to Descending if desired.