Creating data groups

You can organize the column data into custom groups so that the data is easier to read and analyze.

For example, in the Employee code column, you can group employees into ranges, such as 0-100, 101-200, 200+. In the Manager column, you can group managers according to their rank, such as First line manager, Senior manager.

About this task

Depending on the column data type, you can create data groups by using the following styles:
  • Numeric style.

    Each data group includes a range of values. By default, this style is available for columns with numeric data types. However, while you create the data group, you can switch to the text style, and continue switching between the two styles until you save the group.

  • Text style.

    Each data group includes individual values. By default, this style is available for columns with text data types. For columns with numeric data types, you can switch to this style when you create a data group.

For stand-alone (global) calculations, data grouping is available only when the Aggregate property on the calculated column is set to None, and the data type is numeric or string.

Note: For columns that contain large number of items, it might be more efficient to define conditional groups manually by using the expression editor.

Procedure

  1. In the data module tree, right-click the column where you want to group data, and click Create data group.
  2. If you selected a numeric column, set the groups in the following way:
    1. In the Name field, specify a name for the grouped column.
    2. From the Groups menu, select the number of groups that you want to create. Each group is automatically assigned an equal number of values. When you change the number of groups, the values are dynamically redistributed, and the range values are set.
    3. In the Group names column, replace the automatically generated labels with meaningful names. However, if you change the number of groups, the custom labels are cleared, and the automatically generated labels are restored for each group.
    4. If needed, manually lock the Range border values for each group. The Higher and Lower range border values can be changed to numeric inputs. To return to the equal distribution of values, click the Reset distribution Reset distribution icon icon.
    5. Optional: To create a group for NULL values, select the Group NULL values as checkbox, and type a name for the group.
    6. If you want to switch to the text style, click Create a data group (text style) and proceed to step 3. You can continue switching between the Create a data group (numeric style) and Create a data group (text style) dialog boxes until you click Create.
    7. Click Create.

    The data group appears in the data tree, at the top of the list of columns in the table. In the following example, it's the Unit cost(Group) column.

    Numeric data group

    The data group view in the data tree also includes a column that represents the number of groups (Unit cost(Group)_bin_nr). This column is hidden by default, but you can edit its properties, including the label and expression. If you change the label on this column (for example, to Unit cost - groups), and then edit the data group through the Edit data group option, the column label is changed back to its default value (Unit cost(Group)_bin_nr).

    If you selected the Replace the existing column checkbox, the grouped column replaces the original column in the table.

  3. If you selected a text column, set the groups in the following way:
    1. In the Name field, specify a name for the grouped column.
    2. In the Groups box, click New group, and type a group name.
    3. In the Remaining items in column box, control-select the values to include in the group, and click the Add to group icon Right-pointing arrow. The values are moved to the Group items box.
      Note: The maximum number of items that can be preloaded in the Remaining items in column box is 32000. You can select from these items to add them to the groups that you define.
    4. Repeat steps b to c to create more groups.
    5. Optional: To create a group that contains all of the values that aren't already included in any group, select the Group remaining and future values in checkbox, and type a name for the group.
    6. Optional: To replace the original column in the table with the grouped column, select the Replace the existing column checkbox.
    7. Click OK.

    The data group appears in the data tree, at the top of the list of columns in the table. In the following example, it's the Neighborhood(Group) column.

    Text data group

    If you selected the Replace the existing column checkbox, the grouped column replaces the original column in the table.

What to do next

To edit the data group, click its context menu icon Vertical actions menu icon, and select Edit data group. If you need to modify the group expression, go to Properties, and for the Expression property, click the View or edit link. After you modify the expression and save it, the Edit data group option is no longer available from the data group context menu. The only way to edit the data group in the future is through the View or edit link.

Note: You can't change the data group style (from numeric to text, or from text to numeric) by editing the data group.