Custom Filters
Download: Custom Filter
Introduction
This article explains how to create custom filters as a plugin in Sisense.
Purpose/Benefits
Sisense comes with a set of native/robust filter options, but these are always displayed on the right side of the dashboard. If you wanted to create your own set of custom filters, this plugin shows an example for how this could look.
Steps
The following steps will walk through the process of adding the plugin and creating a custom filter.
Step 1 - Add the Plugin
Download the attachment and unzip the contents into your C:\Program Files\Sisense\PrismWeb\plugins\ folder. If you are using version 7.2 and higher unzip the contents into your C:\Program Files\Sisense\app\plugins\ folder. If the plugins folder doesn't exist, just create it. After those files have been unzipped there, you may also have to restart the web server. Now when you create a new widget, FILTER should show up in the list of options
Step 2 - Create the Filter
On your dashboard, click the Create Widget button and select Advanced Configuration. Next, select Filter from the chart types menu. Pick a dimension you want to filter against, and you should see a filter menu displayed.
By default, the items that show up in the menu will be filtered by any dashboard filters that are set. If you want to ignore certain filters, make sure to disable the dashboard filter from the widget editor's Filters pane (see the City filter above)
Back on the dashboard, you can use the new filter menu to make selection and the filters will be added automatically to the dashboard. This works whether you are showing the filters pane or not, and with embedded solutions.
Notes
- This plugin supports only text-based filter dimensions
- All formatting/styling is handled through CSS, so if you want to customize it just modify the file widget.css
- The HTML generated for the menu is defined in widget-template.html
- UPDATED 2016-05-03: This plugin has been updated to work with dependent filters
- UPDATED May 16th, 2016: This plugin has been updated to work with date dimensions
- UPDATED July 5th, 2016: Modified to work with v6.4
- UPDATED Oct 17th, 2016: This plugin has been updated to resolve several issues.
- Display on mobile/tablet devices has been adjusted to take up less screen real estate.
- Fixed an issue where sometimes clicking on the No Selection option would not update the dashboard.
- Fixed an issue where stacking multiple dropdowns on top of each other resulted in an overlapped display.
- Numeric data types are now supported, previously this worked as long as you specified a format for the number. Now this works regardless of having a number format
- Added an option to determine what happens when users make selections. When set to true, the filter will display the entire list of options instead of being sliced down to only what the user selected.
- UPDATED March 24, 2017 - Included an option to specify whether or not to include the "No Selection" button.
- UPDATED May 18, 2017 - Fixed for version 6.6, and added an option to sort by a different field
References
- Dropdown Menu Reference - The dropdown menu used in this plugin came from example 3 on this site
-
Thanks Takashi, that works for me too! On a side note, is there a way to always hide the right hand filter pane (even after they pick something)? For example, on our home page, I want to have this be the only filter displayed and I don't want the right hand pane to take up real estate.
Thanks again!
Malinda
-
Hi Takashi,
I love this Plugin. Unfortunately, I've been receiving a Widget Error (widget type:filterWidget is not registered) while running on version 6.6.1.13002. Performing an IIS Reset on my server seems to clear the error, but I find myself needing to perform this more and more frequently. Is there something I should be doing on my end to prevent this error?
-
Hey Takashi,
This is a great widget. First off thank you for taking the time to create this for anyone to use. One addition that would be useful would be to allow multiple selections. For example, if the filter is for employees, it would be useful to be able to select Bob, Dan, and Sue so that you could compare their performance. Just a thought.
-chris
-
Hi Takashi Binns,
This is a very helpful plugin. Thanks for sharing. Supporting Chris Bridges's answer multiple selection of values (typically check boxes) would be much helpful. One more addition by my part is a text input box (Search box) on the top of the list would be great. We are waiting for that, any help is much appreciated. Please leave a comment if you are able to help.
Thank you,
Ajith
-
Hi guys,
@Malinda - If you share the dashboard with the right filters panel collapsed, then it should show up that way for your end users. I don't believe theres a way to force it closed with JavaScript
@Todd - version 6.6 introduced a new plugin framework, so that may have resulted in different behavior from your previous version. Is there a test machine you can upgrade to 6.7.1 and see if you get the same problem?
@Chris and Ajith - I hear you that it would be cool to add in multiselect and a searchbox, but its quite a bit of development to build all this. I'll keep a note of this feature request (you're not the first people to ask) and add it to our backlog.
@Brian - I've tested this plugin on version 6.7.1 and didn't see any issues. Can you provide further details on the issue you're seeing?
-
I am using the "filter widget" widget
I have a problem, because I continuously get the following message
"widget type: filterWidget is not registered"
I do not understand what is due.
my version of sisense is 7.0.2.13001
This is the error,
appears where the widget should be -
Thank you, he has given me many opportunities.
my solution has been: enter the administration module (admin), section "system configuration", "plug-ins", disable the plugin "filterwidget" and then re-enable it.It has already happened to me several times. So I do not think it's the best solution for me.
-
Hi guys,
@Melanie - I can confirm that the custom filter widget does work w/ version 7, even for multiple data sourced dashboards. Of course the filters will work the same way as regular dashboard filters, in that filters from EC 1 will only affect widgets that consume data from EC1.
@Jose - The behavior you are describing is strange because it seems the plugin is being disabled and you need to re-enable it manually. Do you know what triggered this change? was it after an upgrade? In any case, you should be able to add the bold line below to your plugin.json file within the filterWidget folder. This is basically where the enabled/disabled flag gets stored, when you make the change in your admin panel. This was new in version 7
{
"name": "filterWidget",
"source": [
"dropdown.js",
"stylerController.js",
"widget.js"
],
"style": [
"widget.css"
],
"lastUpdate": "2018-04-13T22:20:42.744Z",
"folderName": "filterWidget",
"isEnabled": true,
"version": "0"
} -
Thanks Takashi Binns
"The behavior you are describing is strange because it seems the plugin is being disabled and you need to re-enable it manually."
No, I'm sorry, I've explained badly.
The plugin is NOT disabled alone.
When the error occurs, I manually disable it, and manually enable it.
"Do you know what triggered this change? was it after an upgrade?
The error started, some weeks after upgrading to V7.
"In any case, you should be able to add the bold line below to your plugin.json file within the filterWidget folder. This is basically where the enabled/disabled flag gets stored, when you make the change in your admin panel. This was new in version 7"
I opened the file plugin.json and the line inside the file, already appears enable
Today the error remains, although I enable and disable the plugin.
The error disappeared when I left the board, closed my session and went back inside.
it's strange.
If it happens again, I'll comment again. -
Hey Takashi Binns
Wondering if its possible with this to scan the number of values in the filter and toggle enabling and disabling the dropdown functionality and clear selection option.
What I am hoping to do is be able to use the same filter on a dashboard and dynamically adjust the UX based on the user logged in. Based on data security and permissions there are some cases where a user will only see 1 value. Currently using the plugin the dropdown menu will still function. Ideally, I would like the single value allocated to that user to instead be displayed and the dropdown disabled. Other users that have 2 or more value options would still function as is with the current plugin.
Any thoughts?
Thanks
-
We upgraded to 7.2 yesterday, and the filter widget is completely broken. I've added the missing code to the plugin.json file, stopped and restarted the site, and it's still not working. We use this filter on probably 90% of our dashboards.
SyntaxEditor Code Snippet
"isEnabled": true, "version": "0"
-
I can't figure out how to make the Sort option work. The filter is displaying a "Reporting Date" character field. This field contains the dates of the past 35 days, except for yesterday, in which the date value is replaced with the literal word 'Yesterday' We do this so that Yesterday is always the default selection, and in our underlying data the date that is replaced with Yesterday changes daily. This provides our users with an updated dashboard daily while giving them the ability to look back at previous days. Since this is a character field, it doesn't sort how I want it to.I would want Yesterday to be first, and then all of the other 34 dates in reverse order (most recent first). We can't use Sisense's date TimeFrames because they don't align to our fiscal calendar.
I have another measure which is in the same table / rows as the fields providing the Reporting Date values. These are numeric Date IDs (e.g. 20190509 for 5/9/2019). I would like to use this field to drive the sort. However, when I try to add this DateID field to the sort, it wants me to do an aggregate (count, max, etc.), and I don't get the desired result.
Help, please.
-
This plugin is promising, but it doesn't work as intuitively as we'd like. Also, there are no styling options to make it look more natural with native widgets.
When you click the dropdown to reveal the options, the "modal" sometimes is above or behind other widgets. When it does pop-up like it should, clicking outside of the menu doesn't close it like a normal <select></select> element. You have to click the widget itself to toggle the modal.
Can you make these updates, please? :)
-
Hi
We are using this Filter plugin for Year and Month dropdowns across all dashboards. Dashboards are made in one environment and rolled over to another once ready, i.e. DEV->PROD deployment. Same name and schema Elasticube exist in both environment but the one on PROD is 2-3 months behind DEV in data, this is making our Filter selections (most recent Year & Month) from DEV deployment invalid for PROD.
We would like the Filters plugin to have an AUTO-SELECTION feature to select a value on-the-fly based-off of the cube.
Meanwhile, if anyone could suggest a work around to it that would be much appreciated!
Thanks
AY
Please sign in to leave a comment.
Comments
56 comments