Switchable Dimensions

By:
Sisense
The Switchable Dimensions add-on allows you to provide several views of your data. With the Switchable Dimensions add-on, you can easily toggle between dimensions displayed in a widget. The Switchable Dimension add-on can be set for categories, values, rows, columns or any other dimension that exists in a widget.  

To install the Switchable Dimensions add-on:

  1. Download the attachment.
  2. Extract the .zip folder into the plugins folder. If the folder does not exist, create it prior to extracting the .zip file.
    For V7.1 and earlier
    : C:\Program Files\Sisense\PrismWeb\plugins
    For V7.2 and later
    : C:\Program Files\Sisense\app\plugins
  3. After those files have been unzipped there, you may also have to restart the web server.
  4. Create the widgets that will have switchable dimensions.
  5. Open the widgets script editor and paste the following code:

    prism.registerSwitchDimension({
    			widget: widget,
    			maxItemsBeforeSubMenuIsCreated: 5,  //optional                              
    			dimensions: [
    			{
    			panel: '<PANEL_NAME>', 
    			affectAllWidgets: true,  //optional (true|false)
    			dims: [
    			{
    			"index": 0,                                 
    			"dim": "[<TABLE_NAME>.<FIELD_NAME>]",                  
    			"datatype": "<DATATYPE>",                         
    			"title": "", //optional                          
    			"widgetTitleTemplate": "" //optional          
    			},
    			{
    			"index": 0,                                 
    			"dim": "[<TABLE_NAME>.<FIELD_NAME>]",                  
    			"datatype": "<DATATYPE>",                         
    			"title": "", //optional                          
    			"widgetTitleTemplate": "" //optional          
    			}
    			]
    			}
    			]
    		});
  6. In the script pasted in the previous step, replace the following placeholders with the relevant values: “maxItemsBeforeSubMenuIsCreated”: When total count of dimensions exceeds this value, the list of dimensions in the context menu will be placed under submenu. The default value is 5.
    “panel”: “<PANEL>” Define the panel name according to the switchable field’s location in the widget (the panels are located on the right side when editing a widget).
    “affectAllWidgets”: Boolean value. If this value is true, switching dimension will be applied for every widget from a dashboard which has the same panel as the one from the configuration. The default value is false.
    “dim”: The dimension to be switched to. This property is case sensitive.
    “datatype”: Dimension data type. It’s important to set correct the datatype. Allowed datatypes include “datetime”, “text”, “numeric”.
    “title”:”<TITLE>” Edit the title of the field. This is displayed when right-clicking to switch dimensions.
    “widgetTitleTemplate”: A string template that enables dynamic widget titles to be displayed. When defined, a widget title will be dynamically changed according to the given template. The template must contain a {{dim}} variable that will be automatically replaced with the dimension title. The default value is the dimension title.
  7. Click Apply to save your changes and refresh the dashboard to display your switchable options.

Example
The widget script below allows you to switch between Country, Brand & Category for the Categories panel and Age Range, Gender for the Break by panel. Switching between dimensions in the Break by panel will affect all widgets from a dashboard that has the Break by panel.

prism.registerSwitchDimension({
   widget: widget,
   dimensions: [
      {
           panel: 'categories',                                    
           dims: [
              {
                  "index":0,
                  "dim":"[country.Country]",
                  "datatype": "text",
                  "title":"Country"
              },
              {
                 "index":0,
                 "dim":"[brand.Brand]",
                 "datatype": "text",
                 "title":"Brand"
              },
              {
                  "index":0,
                  "dim":"[category.Category]",
                  "datatype": "text",
                  "title":"Category"
               }
            ]
        },

      {
         panel: 'break by',
         affectAllWidgets: true,
         dims: [                             
            {
                "index":0,                                 
                "dim":"[Commerce.Age Range]",
                "datatype": "text",
                "title":"Age range"
            },
            {
               "index": 0,
               "dim": "[Commerce.Gender]",
               "datatype": "text",
               "title": "Gender"
            }
         ]
      }
   ]
});
This is a free add-on, click here to get it now.
  • Category:
    • Navigation
  • Last Updated
    5 months ago
  • Earliest Supported Version
    6.7
  • Latest Supported Version
    7.2
  • Tags
    • toggle
    • transition