Skip to main content

Comparison

A Comparison widget displays a summary table with the values of the selected data attributes in different groups.

Use the widget to compare multiple values from different categories within a single widget. For example, you can compare the average bill in restaurants from different areas of the city.

Case example: compare the average number of floors in buildings from different administrative districts:

Comparison widget

Main features

  • The values of comparison attributes are grouped in the widget by columns. As groups, you can select:

    • Territories:

      • Standard territories: regions, districts, settlements, and others.

      • Custom territories: first upload your own dataset with polygons and create a territory filter.

      • Territories specified in geofilters for the current dashboard scene.

      • Data visualization elements in layers with H3, Contour, or Polygon methods. To select an element, click on it on the map. Example:

        Selecting a group by clicking on the map

    • Time ranges.

  • Each column contains the values of the selected comparison attributes (aggregation attributes). The attributes can belong to different data layers. As comparison attributes, you can select:

    • Numeric attributes: to count the number of values in the sample or to count values of the attributes using aggregation functions: total, mean, minimum, maximum value, median, and percentile.
    • Text attributes, logical attributes, or number of objects: to count the number of values in the sample.
  • The maximum number of groups (columns) in the widget is 100. The maximum number of comparison attributes is 100.

  • If necessary, you can edit the names of the comparison attributes displayed in the widget. The attribute names in the dataset will not change.

  • You can display in the widget the attribute values in groups or the difference between them and the values in the target group.

  • Changes in layer data are automatically reflected in the widget.

  • If the filtering by territories or data attributes is applied on a dashboard scene, only the values that match the filters are displayed in the widget. For more information, see the Filtering data on a dashboard instruction.

Creating a widget

Example of creating a Comparison widget
  1. Go to the Dashboards tab.

  2. Open the dashboard.

  3. Open the scene using the arrows Left arrow and Right arrow. If the dashboard has only one scene, it will open automatically.

  4. In the top menu of the dashboard, click the Widgets icon.

  5. Select the Comparison widget type.

  6. Specify the required parameters:

    • Groups: territories or time ranges for which attribute values are calculated.
    • Comparison attributes: values displayed in the widget:
      • Layer: data layer containing the required attributes. If you work with the uploaded data, make sure it contains at least one attribute.
      • Aggregation attribute: attribute used to aggregate data and calculate the values.
      • Aggregation type: function used to calculate aggregation attribute values.
  7. Set the remaining widget parameters if necessary.

  8. Click Create.

The new widget is automatically added to the selected dashboard scene.

Parameters

General widget settings

Parameter
Description
Widget nameWidget name.

Groups

Parameter
Description
TerritorySelecting territories as groups for comparison. You can select:
  • Standard territories: regions, districts, settlements, and others. In the Find the territory field, search by names. You can specify search filters (for example, search only for regions).
  • Custom territories: first upload your own dataset with polygons and create a territory filter. In the Find the territory field, search by territory names that you specified in the properties when uploading the dataset. You can specify search filters to search for territories in particular datasets.
  • Territories specified in geofilters for the current dashboard scene. To use them, click Synchronously with geofilters. When geofilters in the scene are changed, the groups in the widget are also changed automatically.
  • Data visualization elements from layers with H3, Contour, or Polygon methods. The layer must be shown on the scene. Select a layer and click the required elements on the map.
The maximum number of territories is 100.
By timeSelecting time ranges as groups for comparison. Available only for layers from datasets containing attributes with the Date type.

As values, you can select the following:
  • Period: custom period:
    • Step: size of the time range (day, week, month, or year).
    • Start: beginning of the period.
    • End: end of the period. The specified upper (right) limit is included in the range.
  • Last: period before the current date to display the data. For example, the last 4 weeks or 1 year.
The maximum number of ranges is 100.
GroupsYou can perform with groups the following operations:
  • Rename a group: double-click the group or click Edit icon in the group row, enter a new name, and press Enter. Available only for data visualization elements.
  • Change the order of groups (columns) in the widget: hold Drag and drop icon for the group and drag it. Not available when using the Synchronously with geofilters option and when selecting the By time grouping.
  • Make a group target: click Pin icon in the group row. Values in other groups (columns) will be compared to the target values in this group. For more information on display settings, see the Target value section.
    Example of a widget with a target group:
    Widget with a target group

Comparison attributes

Parameter
Description
LayerData layer containing the required comparison attributes:
  • For the Territory grouping, you can select any layer.
  • For the By time grouping, you can only select layers from datasets containing attributes with the Date type. Additionally, specify the attribute with the Date type that will be used for grouping.

To add an additional data layer, click Add layer. You can select one layer multiple times.

To change the order of layers and the corresponding attributes in the widget, hold Drag and drop icon for the layer and drag it. To delete a layer, click Cross icon.

The maximum number of layers is 100.
Aggregation attributeAttribute, which value is aggregated and displayed in the widget:
  • Text attribute. You can select any attribute values from the data sample. When you modify the sample, the available attribute values are changed.
  • Numeric attribute.
  • Logical attribute. Available values are Yes and No/Unknown.
  • Number of objects.

When the data value changes, the value in the widget is also updated automatically.

To add an additional data attribute, click Add attribute. To change the order of attributes (rows) of one layer in the widget, hold Drag and drop icon for the attribute and drag it. To delete an attribute, click Trash icon.

The maximum number of attributes for each layer is 100.
Aggregation typeFunction used to calculate values of the comparison attribute (aggregation attribute) in each group.

For numeric attributes:
  • Sum: sum of values.
  • Mean: mean value.
  • Min: minimum value.
  • Max: maximum value.
  • Median: median value that is equal to or greater than 50% of values in the group.
  • 80th percentile: value that is equal to or greater than 80% of values in the group.
  • 95th percentile: value that is equal to or greater than 95% of values in the group.
  • 99th percentile: value that is equal to or greater than 99% of values in the group.

For text attributes, logical attributes, and number of objects:
  • Quantity: number of objects in the sample.
Attribute nameTo rename a comparison attribute (aggregation attribute) displayed in the widget, click Edit icon and enter a new value. The comparison attribute name in the dataset will not change.
FormattingFormat of the comparison attribute (aggregation attribute) value displayed in the widget. To change the format, click Edit icon and select a format:
  • Without formatting: thousands are separated by commas, and the fractional part is separated by a point.
    Example: 12345.6789 → 12,345.6789.
  • 1.2345 → 1.235: rounding to thousandths (by the rounding rule to the nearest integer).
    Example: 12345.6789 → 12,345.679.
  • 1.2345 → 1.23: rounding to hundredths (by the rounding rule to the nearest integer).
    Example: 12345.6789 → 12,345.68.
  • 1.2345 → 1.2: rounding to tenths (by the rounding rule to the nearest integer).
    Example: 12345.6789 → 12,345.7.
  • 1.2345 → 1: rounding to integers (by the rounding rule to the nearest integer).
    Example: 12345.6789 → 12,346.
  • 1,200 → 1K: compact number notation with indication of magnitude. Only for numbers from 1000.
    Examples: 12345 → 12K, 1234567 → 1M.
  • 1,256 → 1,260: smart rounding to tens. The integer part is rounded to tens, and the fractional part is discarded. Only for numbers from 10.
    Example: 12345.6789 → 12,350.
  • 1,256 → 1,300: smart rounding to hundreds. The integer part is rounded to hundreds, and the fractional part is discarded. Only for numbers from 100.
    Example: 12345.6789 → 12,300.
  • 1,257 → 1,000: smart rounding to thousands. The integer part is rounded to thousands, and the fractional part is discarded. Only for numbers from 1000.
    Example: 12345.6789 → 12,000.
  • 0.12345 → 12.345 %: converting to percentages. The maximum number of decimal places is 3.
    Examples: 0.12345 → 12.345%, 1 → 100%.
  • 1,200,000 → 1.2E6: scientific format (exponential notation).
    Examples: 12345 → 1.235E4, 1 → 1E0.

Target value

You can set the target value to compare the values from other groups to in one of the following ways:

Selecting a target value

Parameter
Description
Target groupGroup with one or multiple target values. Values in other groups (columns) will be compared with values in this group.
Calculation methodFunction used to calculate the change in the group values relative to the target value. Click Edit icon and select the method:
  • Difference: shows the difference between the group value and the target value, taking into account the sign. Example:
    • Group value: 70
    • Target value: 100
    • Calculation result: 70 - 100 = -30
  • Absolute difference: shows the difference between the group value and the target value, ignoring the sign (difference modulus). Example:
    • Group value: 70
    • Target value: 100
    • Calculation result: |70 - 100| = 30
  • Percentage of the target value: shows as a percentage the ratio of the group value to the target value. Example:
    • Group value: 120
    • Target value: 80
    • Calculation result: (120 ÷ 80) ⋅ 100% = 150%
  • Percentage difference: shows as a percentage the ratio of the difference between the group value and the target value to the target value. Example:
    • Group value: 120
    • Target value: 80
    • Calculation result: ((120 - 80) ÷ 80) ⋅ 100% = +50%
  • Ratio: shows as a coefficient how many times the group value is greater or less than the target value. Example:
    • Group value: 200
    • Target value: 100
    • Calculation result: 200 ÷ 100 = 2
  • Relative change: shows the ratio of the difference between the group value and the target value to the target value. Example:
    • Group value: 120
    • Target value: 80
    • Calculation result: (120 — 80) ÷ 80 = +0.50
DisplaySettings for displaying calculation results and the color of icons that show changes in values in groups relative to the target.

To specify the icon color, click Edit icon and select a color from the palette or specify it in the HEX format.

To specify the display method of calculation results, click Edit icon and select the method:
  • Difference and arrow
  • Difference only
  • Arrow only
  • Hide: in this case, only the column with the target group is pinned in the widget

Icon display rules:
  • Up arrow (↑) is displayed when the group value is greater than the target value. Examples: Difference > 0 or Percentage of the target value > 100%.
  • Down arrow (↓) is displayed when the group value is less than the target value. Examples: Difference < 0 or Percentage of the target value < 100%.
  • Right arrow (→) is displayed when the values are equal. Examples: Difference = 0 or Percentage of the target value = 100%.

Entering a target value manually

Parameter
Description
Target group nameName of the target group that will be displayed in the widget.
ValueTarget constant value to compare values in groups. The target value does not change until you specify a new one when editing the widget.
Calculation methodFunction used to calculate the change in the group values relative to the target value. Click Edit icon and select the method:
  • Difference: shows the difference between the group value and the target value, taking into account the sign. Example:
    • Group value: 70
    • Target value: 100
    • Calculation result: 70 - 100 = -30
  • Absolute difference: shows the difference between the group value and the target value, ignoring the sign (difference modulus). Example:
    • Group value: 70
    • Target value: 100
    • Calculation result: |70 - 100| = 30
  • Percentage of the target value: shows as a percentage the ratio of the group value to the target value. Example:
    • Group value: 120
    • Target value: 80
    • Calculation result: (120 ÷ 80) ⋅ 100% = 150%
  • Percentage difference: shows as a percentage the ratio of the difference between the group value and the target value to the target value. Example:
    • Group value: 120
    • Target value: 80
    • Calculation result: ((120 - 80) ÷ 80) ⋅ 100% = +50%
  • Ratio: shows as a coefficient how many times the group value is greater or less than the target value. Example:
    • Group value: 200
    • Target value: 100
    • Calculation result: 200 ÷ 100 = 2
  • Relative change: shows the ratio of the difference between the group value and the target value to the target value. Example:
    • Group value: 120
    • Target value: 80
    • Calculation result: (120 — 80) ÷ 80 = +0.50
DisplaySettings for displaying calculation results and the color of icons that show changes in values in groups relative to the target.

To specify the icon color, click Edit icon and select a color from the palette or specify it in the HEX format.

To specify the display method of calculation results, click Edit icon and select the method:
  • Difference and arrow
  • Difference only
  • Arrow only
  • Hide: in this case, only the column with the target group is pinned in the widget

Icon display rules:
  • Up arrow (↑) is displayed when the group value is greater than the target value. Examples: Difference > 0 or Percentage of the target value > 100%.
  • Down arrow (↓) is displayed when the group value is less than the target value. Examples: Difference < 0 or Percentage of the target value < 100%.
  • Right arrow (→) is displayed when the values are equal. Examples: Difference = 0 or Percentage of the target value = 100%.

What's next?