{ "title": "Automatic Filter Cascading", "desc": "", "source": null, "type": "dashboard", "style": { "palette": { "name": "Vivid", "colors": [ "#00cee6", "#9b9bd7", "#6EDA55", "#fc7570", "#fbb755", "#218A8C" ] } }, "layout": { "instanceid": "5490A-D2A3-19", "type": "columnar", "columns": [ { "width": 100, "cells": [ { "subcells": [ { "elements": [ { "minHeight": 128, "maxHeight": 2048, "minWidth": 128, "maxWidth": 2048, "height": "296px", "defaultWidth": 512, "widgetid": "65774e570b87a70033ea6a20", "autoHeight": "732px" } ], "width": 33.333333333333336, "stretchable": false, "pxlWidth": 366.152, "index": 0 }, { "elements": [ { "minHeight": 96, "maxHeight": 2048, "minWidth": 128, "maxWidth": 2048, "defaultWidth": 512, "widgetid": "65775b9f0b87a70033ea6a5e", "height": "296px" } ], "width": 33.333333333333336, "stretchable": false, "pxlWidth": 366.152, "index": 1 }, { "elements": [ { "minHeight": 96, "maxHeight": 2048, "minWidth": 128, "maxWidth": 2048, "defaultWidth": 512, "widgetid": "65775bb40b87a70033ea6a60", "height": "296px" } ], "width": 33.333333333333336, "stretchable": false, "pxlWidth": 366.152, "index": 2 } ] } ], "pxlWidth": 1098.49, "index": 0 } ], "container": { "sizzle1702319230651": { "undefined": { "parentNode": [ 220.91136415370465, 27, true ] } } } }, "original": null, "previewLayout": [], "oid": "65774e570b87a70033ea6a1f", "dataExploration": false, "lastOpened": null, "datasource": { "fullname": "localhost/Sample Healthcare - Automatic Cascading Filter Test", "id": "localhost_aSampleIAAaHealthcareIAAaLQAaIAAaAutomaticIAAaCascadingIAAaFilterIAAaTest", "address": "LocalHost", "database": "aSampleIAAaHealthcareIAAaLQAaIAAaAutomaticIAAaCascadingIAAaFilterIAAaTest", "live": false, "title": "Sample Healthcare - Automatic Cascading Filter Test" }, "filters": [ { "jaql": { "table": "Admission Date", "column": "Admission_Date", "dim": "[Admission Date.Admission_Date (Calendar)]", "datatype": "datetime", "merged": true, "level": "years", "collapsed": true, "title": "Admission Date", "isDashboardFilter": true, "datasource": { "fullname": "localhost/Sample Healthcare - Automatic Cascading Filter Test", "id": "localhost_aSampleIAAaHealthcareIAAaLQAaIAAaAutomaticIAAaCascadingIAAaFilterIAAaTest", "address": "LocalHost", "database": "aSampleIAAaHealthcareIAAaLQAaIAAaAutomaticIAAaCascadingIAAaFilterIAAaTest", "live": false, "title": "Sample Healthcare - Automatic Cascading Filter Test" }, "filter": { "explicit": true, "userMultiSelect": false, "multiSelection": false, "members": [ "2013-01-01T00:00:00" ] } }, "instanceid": "B2FF5-4035-AD", "isCascading": false, "disabled": false }, { "jaql": { "table": "Discharge Date", "column": "Discharge_Date", "dim": "[Discharge Date.Discharge_Date (Calendar)]", "datatype": "datetime", "merged": true, "level": "years", "collapsed": true, "title": "Discharge Date", "isDashboardFilter": true, "datasource": { "fullname": "localhost/Sample Healthcare - Automatic Cascading Filter Test", "id": "localhost_aSampleIAAaHealthcareIAAaLQAaIAAaAutomaticIAAaCascadingIAAaFilterIAAaTest", "address": "LocalHost", "database": "aSampleIAAaHealthcareIAAaLQAaIAAaAutomaticIAAaCascadingIAAaFilterIAAaTest", "live": false, "title": "Sample Healthcare - Automatic Cascading Filter Test" }, "filter": { "explicit": true, "userMultiSelect": false, "multiSelection": false, "members": [ "2013-01-01T00:00:00" ] } }, "instanceid": "2EE5D-E186-C3", "isCascading": false, "disabled": false, "locked": true }, { "jaql": { "table": "Last Visit Date", "column": "Last_Visit_Date", "dim": "[Last Visit Date.Last_Visit_Date (Calendar)]", "datatype": "datetime", "merged": true, "level": "years", "collapsed": true, "title": "Last Visit Date", "isDashboardFilter": true, "datasource": { "fullname": "localhost/Sample Healthcare - Automatic Cascading Filter Test", "id": "localhost_aSampleIAAaHealthcareIAAaLQAaIAAaAutomaticIAAaCascadingIAAaFilterIAAaTest", "address": "LocalHost", "database": "aSampleIAAaHealthcareIAAaLQAaIAAaAutomaticIAAaCascadingIAAaFilterIAAaTest", "live": false, "title": "Sample Healthcare - Automatic Cascading Filter Test" }, "filter": { "explicit": true, "userMultiSelect": false, "multiSelection": false, "members": [ "2013-01-01T00:00:00" ] } }, "instanceid": "F923B-E982-3A", "isCascading": false, "disabled": false, "locked": true } ], "editing": true, "parentFolder": "64e4c7b54faf000033a59050", "settings": { "autoUpdateOnFiltersChange": true }, "filterRelations": [], "filterToDatasourceMapping": {}, "script": "/*\n\tWelcome to your Dashboard's Script.\n\n\tTo learn how you can access the Widget and Dashboard objects, see the online documentation at https://sisense.dev/guides/js/extensions\n*/\n\n\n/*************************** This script is used to synchronize the selections of a set of filters ***********************/\n/** E.g. if the first filter is set to ABC, all subsequent filters listed will automatically be updated to ABC as well ***/\n/***************** The script also replicates the disabled state from the first filter to the other filters **************/\n\n//Specify the names of the filters, starting from the first filter, from which the selections will be replicated to other filters\n//This is the only part of the code that requires your input\nvar filterNames = ['Admission Date', 'Discharge Date', 'Last Visit Date']\n\n//Every time a filter is changed, this code is executed\ndashboard.on('filterschanged',function(d) {\n\n\t//Find the first filter by name\n\tvar filter1FilterObject = dashboard.filters.$$items.find((item) => {\n\t\tif (item.jaql && item.jaql.title.indexOf(filterNames[0]) !== -1) {\n\t\t\treturn true;\n\t\t}\n\t});\n\n\t//Get the JAQL filter selection of the first filter\n\tvar filter1FilterObjectJAQL = filter1FilterObject.jaql;\n\n\t//Get the JAQL filter disabled state of the first filter\n\tvar filter1FilterObjectDisabled = filter1FilterObject.disabled;\n\n\t//Define an array for the subsequent filters' objects\n\tvar filterObjects = new Array();\n\n\t//Find each of the subsequent filters by name\n\tfor(i=1 ; i {\n\t\t\tif (item.jaql && item.jaql.title.indexOf(filterNames[i]) !== -1) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t});\n\n\t}\n\n\t//Update the properties of the subsequent filters to match the first filter\n\tfor(i=0 ; i