Filtering data | Urbi Pro | 2GIS Documentation
Urbi Pro

Filtering data through widget

When a widget is created, you can interact with the chart components to quickly display only the data of your interest without editing the data sample. Click one or multiple chart components (bars, columns, or slices) to leave only relevant data on the map, in the legend, and in other widgets.

Example of widget with an active filter

Note

When you filter data through a widget, the data sample in the layer stays the same. Only the number of objects on the map changes.

Filtering by click is available for the following widget types:

The basic method of filtering data through widget. For example, to apply this method to the dashboard scene created during Quick start:

  1. Open the dashboard.

    On the images below, the Demand for pastry shops layer is hidden for convenience.

    Dashboard with no filters
  2. In the previously created Rating widget for the Pastry shops with a rating of 3 and above layer, click the 4-5 rating range (middle line on the chart). As a result:

    • Only the pastry shops with rating between 4 and 5 are left on the map.
    • Data in other widgets created from the same layer is updated. Now the Legend and Number of reviews widgets display only the data for pastry shops with rating between 4 and 5.
    • In the layers list, Filter applied icon appears next to the layer with the filter applied.
    Filter by rating is applied

    If the current dashboard scene contains widgets created from other layers, the filter does not affect them.

  3. To remove the filter, click Filter icon on the corresponding widget or click the selected range again.

If the dashboard scene contains multiple layers created from the same dataset, you can apply a filter to all of them. For example, to apply this method to the dashboard scene created during Quick start:

  1. Open the dashboard.

  2. Create a new layer from the same dataset as the Pastry shops with a rating of 3 and above layer. For example, a layer with Dubai downtown hotels:

    1. Create a layer from the Firms dataset.
    2. In the Geofilter settings dialog, select Burj Khalifa/Downtown Dubai and click Done.
    3. On the Filters tab, click Select categories. Then select Tourism / Leisure → Hotels and click Apply.

    Now two layers with firms are displayed on the dashboard scene.

    Dashboard with two layers with firms
  3. In the previously created Rating widget, click the 4-5 rating range (middle line on the chart).

    By default, the filter is applied only to the Pastry shops with a rating of 3 and above layer, which it was created from.

    Filter is applied to the source layer only
  4. In the same widget, open the drop-down list next to Filter icon and select Apply to all layers.

    Apply the filter to all layers

    As a result, only pastry shops and hotels of the Dubai downtown with rating between 4 and 5 are left on the map.

    Filter is applied to all layers from the dame dataset

    The filter does not affect layers created from other datasets because the set of attributes is different.

  5. To restore the filter behavior, open the drop-down list next to Filter icon again and select Source layer only.

You can select more than one chart components. In this case, filtering conditions are combined by the logical OR operator. For example, if you select two columns (4 and 5) in the Number of reviews widget, only the pastry shops that meet any of these conditions (with 4 or 5 reviews) are left on the map and in other widgets.

Filter by two ranges of one widget is applied

You can filter data through multiple widgets at the same time. In this case, filtering conditions are combined by the logical AND operator. For example, if you select 4 reviews in the Number of reviews widget and the ≥5 rating range in the Rating widget, only the pastry shops that meet both of these conditions (with 4 reviews and ≥5 rating) are left on the map and in other widgets.

If widgets belong to different layers, see more details in the Filtering data of multiple layers section.

Filter with ranges from two widgets is applied