There are multiple ways to filter data in Luzmo, starting from the dashboard level and going down to the chart or authorization request level. In this article, we will cover:
In the Filters section on the side menu of a dashboard, you will see 3 sections:
The Filter section will also have a number pinned to it, that symbolizes the number of filters present on the dashboard. If there is an exclamation mark, that lets you know that an invalid filter is present.
In the "Parameters" section, you can create parameters for use in Dashboard, Chart or Embed filters. Parameters are designed to allow multiple filters to be controlled by a single parameter override when creating embed tokens.
Dashboard filters work by applying filters directly to the datasets that are serving the dashboard. This provides a way to apply filters to every query sent by the dashboard, and can be used to create a view of what the dashboard will look like when embedded, e.g. for a user with access that is limited to a certain organization ID or other parameter.
The "Chart Filters" section shows all chart level filters and their configurations. This section allows you to view and manage all of the filters configured on charts inside the dashboard from a single location.
Once embedded, dashboard and chart filters are not configurable by an end user, unless that user has access to the Embedded Dashboard Editor with "edit" rights on the dashboard.
Chart level filters are configured on individual charts and only affect the queries of charts that they are configured on. In order to add a new filter, you need to click the "Data" button and then the "Add Filter" button. This will open the "Manage filters" modal where you can configure both row-level filters and post-aggregation filters. For this you must click on "Add filter" and then specify the column or formula to use, condition and value.
You are only able to set filters on column and formulas from datasets that are used in the chart.
Filter items are interactive items that can be added to the dashboard. Usable to slice and dice the data.
Please see more details about our filter items in their dedicated articles:
By default, a filter item filters other charts, but it does not filter other filter objects. To enable or disable which items a filter affects, see Interactive object filtering and Filter objects filtering each other
Initialization filters are used to set the state of filter items on the dashboard when the dashboard loads. Initialization filter values can be changed by end users interacting with the filter items on the dashboard. To set up a filter initialization, select the value you want to set in the filter item. Then click the "Settings" button on a filter item, and enable "intialize with filter" under the Filter Intialization heading. To dynamically set initialization filters using embed tokens, please see more details in this article on dynamically setting a filter initialization.
Interactive object filtering allows you to choose whether a filter from a chart or filter item affects other items on the dashboard. By default, filtering is enabled for charts and disabled for filter items. Click on the "Settings" button of a chart or filter item to see which items will be affected by filters set by this item. Dashboard items with the filter icon and shaded in green will be affected, while items with the strikethrough filter icon shaded in red will not be affected. Clicking on a dashboard item will toggle filtering for that item.
Sometimes it is advantageous to have filter items fitler each other, so that as dashboard users set filters, it reduces the possibilities in the next filter. This is especially powerful for related hierarchical data, for example countries and cities. This is a big advantage especially in case of filters with a high range of possible values.
In order to activate filtering, use the same proceedure for interactive object filtering to toggle the filters on:
It is possible to have use one filter object to filter on columns from different datasets. These datasets can be linked datasets in Luzmo or not. This functions best when the columns from both datasets contain the same row level data, for example: dates or company names.
For example: we have two datasets, Dataset A and Dataset B, both with a Date column. To filter both datasets with one filter object:
Now, selecting a date range from the filter will filter both datasets A and B. You can add as many datasets to one filter object as you need.
Filter conditions on the different columns are combined using an AND condition. As usual, each chart will filter based on filters on the datasets used in the chart and filters on datasets linked to the ones used in the chart.
In our example if dataset A & B are linked, then a chart that uses data from dataset A and/or B will be filtered to both date column A AND date column B being in the selected data range. However, if in our example data A & B are not linked, then a chart that uses data from dataset A will be filtered based on date column A being in the selected date range. While a chart using data from dataset B will be filtered based on date column B being in the selected date range.
Aside from the basic chart filters, some charts have additional filtering capabilities that can be activated by interacting with the chart elements directly:
In all charts, clicking the "Clear filter" button will return the dashboard to the initial, unfiltered state.
Embed filters are a powerful way to create multitenancy with row level security. First, set your embed filters to map one or more dataset filters to a parameter. Once the embed filters are set, ensuring that each client sees the correct data is as easy as overriding the parameters with the appropriate values for that user when authorizing an embed token. Please see more details and a step by step guide in our dedicated article on parameter filters.
Authorization filters allow you to set Dashboard level filters and Initialization filters via the embed token. This allows you to customize dashboard filters or initialization filters per user.
Please see more details in our article on static filters and our article on dynamically setting a filter initialization.
Authorization filters can be used to return "no data" when the number of results is smaller than a specified threshold. This can be critical to preserve anonymity in aggregated data sets. More details can be found in our article on how to only show data when there is a minimum number of results
In the share modal of any dataset, you are able to configure the specific users or groups that the dataset will be shared with. In this modal, you can also specify filters that will be applied to all queries run on the dataset by those users or groups.
This is also true in the Embedded Dashboard Editor, where some rules to keep in mind are:
All filters from the dashboard (interactivity filters, dashboard filters, chart filters) are merged with the access filter(s) using "AND" relations. Please see more details in our dedicated article on managing the access granularity of your dashboards and datasets.
When a embed token is generated for a user, access and suborganization must be specified. The bootstrapped user will have access to the resources specified in the "access" section of the token, the resources directly shared with the user or the resources shared with a (suborganization) group that the user is part of. If the user has access to a dashboard or dataset via more than one way (token, group or user share), the following rules are used:
When a SSO token is generated for a user, an Integration and Suborganization must be specified. The bootstrapped SSO user inherits the access rights and filters set on the Integration, (suborganization) group, and user access. If the user has access to a dashboard or dataset via more than one way (Integration, group or user share), the following rules are used: