Input Parameters Plugin (version 2)
Download: Parameters Widget
Introduction
This article explains how to add user input boxes for use as parameters in Widget Formulas.
Purpose/Benefits
This plugin is an extension of an earlier plugin, but adds the ability to have multiple parameters in the same area.
It also provides an option for setting default values for each parameter.
Steps
The following steps will walk through the process of adding the new chart type and creating a sample.
Step 1 - Add the Plugin
For Versions 7.1 and below - download the attachment and unzip the contents into your C:\Program Files\Sisense\PrismWeb\plugins\ folder.
For 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 plugins service.
Now, when you create a new widget the parameters widget should show up in the list of widget types.
Step 2 - Add the default values into the Elasticube
Edit the included Excel file to have the number of parameters you'll need, as well as the default values for each parameter.
In the screenshot below, we are adding in support for up to 5 numeric input parameters.
Once this structure is defined, add it to your Elasticube and perform a build. You should not connect this to any other table, it should be a stand alone.
This doesn't have to be driven from the included Excel sheet, but you should make sure this table is named Parameters in the Elasticube.
Step 3 - Create the Widget
On your dashboard, click the Create Widget button and select Advanced Configuration.
Next, select Parameters from the chart types menu.
Under items, add in 1 or more fields from the Elasticube's Parameters table.
You can override the field names, either in the Elasticube or just the labels in the dashboard.
Each input box will default to the values from your Excel sheet, but users in the dashboard will have the option to override the values.
You can also adjust whether the dashboard updates with these new values immediately after entering them, or if you want the end user to set all the parameters first and then click an UPDATE button.
When finished, click the APPLY button to save this widget to the dashboard.
Step 4 - Reference the Parameters in Formulas
At this point, users can update the inputs but you need to reference these parameters within Widget formulas in order to take effect.
Create/edit a widget's formula and add in a reference to a field from the Elasticube's Parameters table.
The formula editor will default to a SUM of this field, but rename it to @fieldname.value .
For example if your parameter field is named P2 in the Elasticube, then it should be renamed to @P2.value.
In the widget editor the formula will use the default values, but once in the dashboard it should take on the user-input values instead.
Note: the parameter name p1 is case sensitive. So make sure to perform the rename to exactly p1 and not P1
Notes
- This plugin does not save user inputs, each dashboard load will start with the default values.
- If you want to name your Parameters table something different, then you will need to update the included config.js file settings.table property to match.
- This example used an Excel sheet to manage the default parameter values, but these can be persisted anywhere (database, google sheet, etc).
- This plugin is meant as a replacement for the original floating input parameters and parameters plugin combination. If you want to use this one, please remove the other plugins from your Sisense installation first.
- UPDATE Aug 8, 2016 - Updated to work with Sisense v6.4
- UPDATE Dec 14, 2016 - Updated to work with Sisense v6.5
- UPDATE Sep,14, 2018 (Ronen Avidor)- Update to work with version 7.2 and also leave backward compatibility to earlier version
- UPDATE Feb 19, 2019 - added support to save parameters between sessions
-
@Robert, I also did not have the other 2 plugins installed, and got the same error when trying to use the parameter within a Pivot.
It worked for me when using the parameter as part of the calculation within an indicator widget, but I need it to work within a pivot widget. If you can get this to work in a pivot please let me know how you did.
-
@Robert and Robert - I'd suggest deleting all plugins except for this one to verify any possible conflicts. If it works, then add remaining plugins back, in some other cases this approach helped me to resolve some issue. It works for me on Pivot as well, so maybe there is a conflict with other plugin modifying Pivot? Do you use any custom JS on Pivot? In any case it might be good to rise a ticket with Sisense.
-
Can the input parameter be used for Text values?
I would like to use an input parameter to allow for dynamic measured filtering, allowing the user to enter TEXT into the input which will then take on the value of the measured filter.
Not sure if there is a better way.
Any thoughts?
-
@Ahuva - that one will do it for you - https://support.sisense.com/hc/en-us/community/posts/221225128-Filtered-Measure-Plugin-Parameters- please mind that you combine it with this one, as Takashi mentioned in the notes.
-
Hi,
First, Takashi, thanks for this plugin, and double-thanks for commenting the code so thoroughly! It's really helped me understand what this rather complex plugin is doing under the hood. However, I'm trying to add a customization, and falling short. By default, the parameter divs are manifested successively within the parameters span. Sometimes this creates uneven spacing. I'd rather have exactly two columns within the parent span, no matter how the screen is resized, so that there are two even columns of parameters. Is there a way to edit the css or html file to achieve this?
Thanks in advance!
Nick
-
Is anyone else having an issue where input values specified as 0 are not being changed from their default values? For example, I have a few different input parameters, and each have a default value of 5. If I input 0 in one of the inputs to replace a 5, the zero is not recognized, and everything stays at 5.
Anyone else experiencing this? Takashi, is there a way to fix this? Thanks in advance!
Nick
-
Hi,
Currently I am able to use this plugin as advertised to declare the @p2.value in a formula as described above. What I am having an issue with is trying to figure out how to reference @p2.value in a widget filter so that my target list matches the outcomes.
Details.
I use the @p1.value and @p2.value to define a range : that range results in N targets
What I'd like is for the pivot table to be able to filter off the input parameters I put into the widget so that the result set is also N targets instead of me having to go in and set the values for the between filter to match the parameters widget. Is this possible?
-
I'm using this on version 7.2. Love the plugin. I am seeing one issue however - when I first login to Sisense and open a dashboard with this plugin used, the Non Parameter widgets (pivots) get the golden diamond with the error:
- The widget is trying to use fields from two tables that are not connected in the ElastiCube.
Once I hit the Update button on the parameter widget, they go away and the pivot table is shown. Same if Auto Update is on, once I leave a field, the widgets get updated and display correctly.
After that it seems to work just fine. Switching away from and back to the dashboard works fine. However, once I log off and back on, the same thing happens.
Please sign in to leave a comment.
Comments
57 comments