Need a special offer?Find out if your project fits.
+
All documentation
  • Introduction
  • Connecting to Data Source
  • Browser compatibility
  • Documentation for older versions
  • Filter by value

    Using filter by value, you can filter field members based on values of a certain measure. For instance, you can show the top 3 movies with the biggest budget or products with sales lower than 5000.

    About the filter

    Filter by value consists of a measure to filter by, a condition applied to the measure, and values for the condition. Here is an example of a value filter, where Sum of Price is a measure to filter by, Top is a filtering condition, and 5 is a condition value:

    You can apply the value filter to fields in rows and columns. Report filters do not support the value filter.

    In the flat form, the value filter can be applied only to number fields.

    Note Value filter cannot be combined with the conditional and selection filters.

    Availability for data sources

    The filter by value is available for the following data sources:

    Note For the custom data source API, the filter by value must be implemented on your server. For more details, refer to the Implementing filters guide.

    Available conditions

    The following filtering conditions can be applied to a measure:

    • Top – Shows X members with the greatest values, where X is a number you specify.
    • Bottom – Shows X members with the lowest values, where X is a number you specify. 
    • Equal – Shows members with values equal to the specified value.
    • Not equal – Shows members with values not equal to the specified value.
    • Greater – Shows members with values greater than the specified value.
    • Greater or equal – Shows members with values greater than or equal to the specified value.
    • Less – Shows members with values less than the specified value.
    • Less or equal – Shows members with values less than or equal to the specified value.
    • Between – Shows members with values between two values (including them).
    • Not between – Shows members with values not between two values (excluding them).

    Applying the filter

    The filter by value can be:

    • Applied via UI
    • Preset in the report
    • Applied using API calls

    Via UI

    Step 1. Open the filter view by clicking the field’s name or using the field’s context menu.

    Step 2. Select the VALUES filtering option. This will open a subview where you can specify the filter by value.

    Step 3. In the subview, choose a measure to filter by from the dropdown menu. Then, choose a filtering condition and enter a value for it.

    The screenshot below shows an example of a filter configuration:

    Step 4. Once the filter is configured, click the APPLY button to save your configuration.

    In the report

    If you want to preset a filter in your report, we recommend the following approach:

    1. Configure the filter via UI.
    2. Save the report

    Your report will now contain the filter configuration. If needed, you can edit the filter configuration programmatically. To learn more, see the API reference:

    Using API calls

    To set or change the filter at runtime, use the setFilter() API call:

    flexmonster.setFilter("Country", {
      measure: {
        uniqueName: "Price",
        aggregation: "sum",
      },
      query: {
        top: 5,
      },
    });

    You can view the existing filter configuration using the getFilter() method.

    Try a live sample on JSFiddle.

    Clearing the filter

    Learn how to clear the filter by value:

    Via UI

    Step 1. Open the filter view by clicking the field’s name or using the field’s context menu.

    Step 2. Select the Clear value filter option located in the lower-right corner of the subview:

    Step 3. Click the APPLY button to save your changes.

    Using API calls

    You can clear all filters from a field using the clearFilter() API call. For example:

    flexmonster.clearFilter("Country");

    Try a live sample on JSFiddle.

    See also