Knowledge Base Article

Combining filter conditions with custom filter - [Linux-Windows]

This guide shows how to use Custom Filter to layer conditions such as exclusions and top-N limits for more precise results when a single filter condition alone doesn’t provide the control you need.

Step-by-Step Guide:

In many cases, a single filter condition is not enough to focus on the exact data you need. For example:

  • You might want to exclude missing values such as “N/A”, nulls, and blanks, or even specific values like outliers.
  • At the same time, you might want to limit results to the top/bottom N.

Examples scenarios:

  • Top 10 countries outside of the United States by pageviews.
  • Top 5 stores by sales revenue, excluding online orders (where Store is NULL).
  • Bottom 10 countries by population density, excluding Greenland.

To implement these filtering requirements, you can utilize the Custom Filter option. While this is a code-driven (JSON) feature, you can easily build the code by following this structure:

{ "and": [ <condition 1> , <condition 2> ] }

For each condition, you can generate the code by first using the non-custom option, defining the condition, then switching to the custom option. This will automatically populate the Custom Action box with the correct code.

For example, to get the JSON code for countries that are top 10 by revenue and not null:

1. Copy the structure above into a text editor.

2. Set the filter to the top 10 countries using the regular (non-custom) filtering options, as shown below:

3. Switch to the custom option. This will automatically generate the code for the same condition. 

4. Copy the code and paste it into the text editor where the first condition block is.

5. Repeat the same process for the second condition. Define the "is not null" filter by selecting the “Is not” option and “N\A” from the dropdown.

6. Switch to the custom option. This will again generate the code for the condition.

7. Copy the code and paste it into the text editor where the second condition block is. The code is now complete.

8. Copy the entire code and paste it into the Custom Filter editor, as shown below.  Test if necessary, then click Apply to save the filter. The widget should now show the top 10 of non-null countries.

BEFORE, only Top 10:

AFTER, Top 10 and not NULL:

Conclusion 

By combining conditions in a Custom Filter, you can refine results beyond what a single filter condition can do. This lets you, for example, exclude invalid or extreme values while still highlighting the top or bottom entries in the same column.

Disclaimer: This post outlines a potential custom workaround for a specific use case or provides instructions regarding a specific task. The solution may not work in all scenarios or Sisense versions, so we strongly recommend testing it in your environment before deployment. If you need further assistance with this, please let us know.

Updated 09-16-2025
No CommentsBe the first to comment