Filter by selection allows choosing specific field members to display.
Learn more about the filter by selection:
The filter by selection can be used to:
The filter by selection is available for all data sources.
Note For the custom data source API, the filter by selection must be implemented on your server. For more details, refer to the Implementing filters guide.
The filter by selection can be:
Note If you want to preset a filter in your report, we recommend the following approach:
Step 1. Open the filter view by clicking the field’s name or using the field’s context menu.
Step 2. Use the checkboxes to select field members that should be displayed or hidden.
The screenshot below shows an example of a filter configuration:
Step 3. Once the filter is configured, click the APPLY button to save your configuration.
Note You can also use the search box to filter members.
Step 1. In the slice, add the filter
property to the field you want to filter. The field can be from the rows
, columns
, or reportFilters
.
Step 2. Specify one of the following properties as an array of field members:
filter.members
shows the members you specify.filter.exclude
hides the members you specify. Can be combined with the filter.query
property, which represents the conditional filter. filter.include
shows the members you specify in addition to the members returned by the filter.query
, which represents the conditional filter. filter.include
must be used only together with the filter.query
.The field members should be specified in the "<field_name>.[<field_member_name>]"
format. For example:
slice: { rows: [ { uniqueName: "Country", filter: { members: [ "country.[poland]", "country.[uk]", "country.[ukraine]", ], }, }, ] }
Check out the live demo on JSFiddle.
If the members specified in the selection filter do not exist, the filter is ignored and all field members are displayed.
Note that the members
, exclude
, and include
properties are incompatible with each other and must be used separately.
To set or change the filter at runtime, use the setFilter() API call:
flexmonster.setFilter("Country", { members: [ "country.[poland]", "country.[uk]", "country.[ukraine]", ], });
You can view the existing filter configuration using the getFilter() method.
Try a live sample on JSFiddle.
Note Filter by selection is ignored for fields with only one member.
Learn how to clear the filter by selection:
Step 1. Open the filter view by clicking the field’s name or using the field’s context menu.
Step 2. Select the Select all checkbox to choose all members:
Step 3. Click the APPLY button to save your changes.
You can clear all filters from a field using the clearFilter() API call. For example:
flexmonster.clearFilter("Country");
Try a live sample on JSFiddle.