Sisense Community logo
    • Community Feedback
    • Chapters
    • Events
    • Forums
      • Help and How To
      • Product Feedback Forum
      • Strategy & Use Cases
    • Blogs
    • KB Docs
      • KB Docs
      • Add-Ons & Plug-Ins
      • APIs
      • Best Practices
      • Blox
      • CDT
      • Cloud Managed Service
      • Data Models
      • Data Sources
      • Embedding Analytics
      • How-Tos & FAQs
      • Onboarding
      • PySisense
      • Security
      • Sisense Administration
      • Sisense Intelligence & AI
      • Troubleshooting
      • Widget & Dashboard Scripts
    • Support
    • Learning
      • Sisense Academy: Free Courses and Certifications
      • Official Developer Documentation
      • Official Product Documentation
      • Official Sisense Youtube Channel
      • Sisense Compose SDK Playground
    • Use Case Gallery
    All PostsDiscussionsBlogsIdeasQuestions
    Leaderboards
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
    Discussions
    • TagsChevronRightIcon
    Filters
    • Idea
      • Product Feedback ForumChevronRightIcon
      Dashboard filters miss values when a dimension table is linked to multiple fact tables + data security rules
                               
      Inge Vijsma
      Inge VijsmaPosted 1 month ago • Last reply 3 weeks ago
               
      1
               
    • Discussion
      Mia Isaacson
      • Help and How-To
               
      Mia Isaacson
      Dashboard script: automatically reset filters to default when a dashboard is opened
                                               

      Hey everyone 👋 Here's one that comes up more than you'd think. You've got a dashboard with filters. A user applies a bunch of selections, and the next time they (or someone else) opens it, those filters are still there from the last session. Depending on your use case, that might be exactly what you want... but sometimes it isn't. If you'd rather your dashboard always open in a clean, predictable state, with filters resetting to the defaults you set at design time, this dashboard script does exactly that. Every time the dashboard is activated, it removes whatever filters are currently applied and restores the defaults automatically. Here's the full script: dashboard.on("activated", (e, args) => { const dashFilters = args.dashboard.filters; dashFilters.$$items = dashFilters.$$items.splice(0, dashFilters.$$items.length); let filters = args.dashboard.defaultFilters; var options = { save: true, refresh: true, unionIfSameDimensionAndSameType: false, }; if (!Array.isArray(filters)) { filters = [filters]; } dashFilters.update(filters, options); }); Here's what each part is doing: Trigger This fires whenever the dashboard becomes active (when a user opens it or navigates to it). That's the moment everything below kicks off. dashboard.on("activated", (e, args) => { ... }) Step 1: Clear the current filters This grabs the live filter collection and empties it out completely — whatever the user had applied before is gone. const dashFilters = args.dashboard.filters; dashFilters.$$items = dashFilters.$$items.splice(0, dashFilters.$$items.length); Step 2: Grab the default filters defaultFilters is the filter state saved at design time. Whatever you configured as the intended starting point when you built the dashboard. const filters = args.dashboard.defaultFilters; Step 3: Apply the defaults This normalizes the filters into an array, then applies them back with save: true so the reset persists, and refresh: true so the data reloads immediately. The unionIfSameDimensionAndSameType: false setting makes sure it replaces rather than tries to merge with anything. var options = { save: true, refresh: true, unionIfSameDimensionAndSameType: false, }; if (!Array.isArray(filters)) { filters = [filters]; } dashFilters.update(filters, options); When would you actually use this? Shared dashboards where you don't want one user's filter selections to carry over for the next person who opens it Executive or presentation dashboards where the default view is intentional and should always be what people land on Dashboards embedded in portals or apps where a consistent starting state matters Anywhere you've had someone complain that the dashboard "looks different than it usually does" — often it's just leftover filters from a previous session One thing worth knowing The $$items approach in Step 1 is manipulating an internal Sisense array directly. The $$ prefix is a convention for internal Angular properties. It works well, but it's worth keeping in mind that if Sisense changes the internal structure down the road, that line could break without much warning. Something to keep an eye on if you're on this script after an upgrade. Hope this is useful for someone, and happy to answer questions if you run into anything! Mia from QBeeQ, a Sisense Gold Implementation Partner www.qbeeq.io

      4 months ago
      0
               
    • Question
      • Help and How-ToChevronRightIcon
                       
      Dashboard filter limits the list selection
      Rose Holmes-Minton
      Rose Holmes-Minton
      Posted 7 months ago • Last reply 7 months ago
      2
               
    • Discussion
      Rose Holmes-Minton
      • Help and How-To
               
      Rose Holmes-Minton
      Set a background dashboard filter using Javascript
                               

      I am trying to set a background dashboard filter using JavaScript. Any suggestions?  

      7 months agolast reply 7 months ago
      3
               
    • Discussion
      EMS_Data_Guy
      • Help and How-To
               
      EMS_Data_Guy
      Filter Dashboard by Last 24 Hours
               

      In my industry, we mostly work 12 or 24 hour shifts with the most common shift change time being 0600. I have a great dashboard built that looks at the last day and calculates time on task. The only problem is that the only filter that comes close is 'Yesterday' which is looking at 00:00-23:59 on the last calendar day. I need to be able to look at 06:00 on day one to 06:00 the next day.  I tried a couple of tweaks by using the 'Advanced' feature under the filter but none of them worked. Including trying a fractional offset of 0.75. My goal is to have this auto run at 0800 every morning. So, the 'advanced' tab would look like this,  { "last": { "count": 24, "offset": 2 } } I can't make that work now though because the advanced tab only lets you edit the filter for the time period selected and hours isn't a choice. We are using an embedded version of Sisense so I can't edit anything in 'The Cube'.

      9 months agolast reply 8 months ago
      4
               
    • Discussion
      Luke Flett
      • Help and How-To
               
      Luke Flett
      Filter to only show Relevant Dimension Values
                                       

      Morning Sisense community!  I have my Fact Table and a related Dimension Table . My dimension table contains more unique values than are actually present in the fact table. When I use a field from the Dimension Table as a filter, the filter displays all values from the dimension, even those that have no corresponding fact records . I only want the filter to show dimension values that are relevant to the data in the fact table . Example Tables: fact_table   dimension_table   id dim_id dim_id dim_name 1 1 1 one 2 2 2 two 3 1 3 three 4 2 4 four fact_table and dimension_table have a relationship in the EC based on dim_id Desired Outcome: In the filter based on dim_name, I only want to see "one" and "two" , but currently, I see all four: "one," "two," "three," and "four." How do I achieve my desired outcome?

      10 months agolast reply 9 months ago
      5
               
    • Question
      • Help and How-ToChevronRightIcon
                       
      How to have dashboard filters affect a formula filer?
      Rafael Ferreira
      Rafael Ferreira
      Posted 9 months ago • Last reply 9 months ago
      6
               
      • How-Tos & FAQsChevronRightIcon

      Advanced Dynamic Filtering

                               

      Many times we’d like to be able to compare a few items out of a large set to see how they relatively behave. For example, how a certain period did compared to any other period, or how a certain country’s sales or sales representative achieved compared to another. Another feasible option for this would be a financial Trial Balance report in which we’d like to compare several different time periods for beginning balance, ending balance, credit and debit, all to be affected by different months selected from the filter, all in one single pivot table or widget, or across several widgets. This can be achieved by use of the parameters plugin though this requires one to add an additional filter for the same dimension as the number of items you’d like to compare through, i.e. if you’d like to compare 2 date periods or 2 countries, you’ll need 2 different filters, for 3 values or above this can get unmanageable. With this method, one can use one single filter for all items being compared. To achieve this functionality we will be using a combination of  custom fields  in the EC,  measured values ,  ranking filters  and the smart label plugin.  To start, we will create a custom column for the dimension we’d like to dynamically filter, in our example we will use a date dimension, though this logic can be applied on textual values and others. This custom column will hold a unique incremental integer value for each day/quarter/month/year according to what we’d like to compare, in our case we will use months. The best way to reach a unique incremental integer for date elements would be a unique integer representation for each month, in our case we will calculate the number of months which had past since 1/1/1970, a sort of Unix timestamp for months: This way,  when grouped by months, every date will be allocated a value which represents the number of months which have past since the 1st of that month. Note : To achieve this functionality on other textual valued dimensions, in the custom column simply create a ranking value which will grant a unique incremental integer for each value, this can be found in the Math functions in the custom elements function references. Once these values are ready in the dimension table, we can move forward to Sisense web. Basically, in each widget or value you’d like to present these various values, we’ll apply a measured value which will be filtered to a top or bottom ranking value of the custom unique incremental integer value we allocated for each dimension value. To do this, create the measured value, in the filter section as follows, apply the filter: For most recent month selected, we will apply the top ranking, as the most recent month will have a larger int value which we allocated in the custom column, as more months have past since 1/1/1970, for both filters, we will apply the ranking filter according to Max of the same Int value: For the first month selected we will apply the same measured value, this time for the bottom 1, i.e. the lower value of the two. For both filters, we will apply the ranking filter according to Max of the same Int value. Another option in order to improve user experience to better understand which month (or any other value) is represented in each value, one can use the Smart Label widget to show on top of each value, which is the month currently represented, in the filter label widgets we will apply the same filter, at the widget level, of top and bottom ranking according to our unique Incremental integer value respectively: Attached are .dash and .ecdata files via google drive, would appreciate any feedback on this, please do let me know if I can further clarify or assist on any of the above. 1.  Dashboard example with dates 2.  Dashboard example with Countries

      intapiuser
      intapiuserPosted 3 years ago • Last reply 10 months ago
      1
               
      • Widget & Dashboard ScriptsChevronRightIcon

      Dynamically Updating Widget Titles Based on Filter Selections in Sisense (Linux)

                               

      Dynamically Updating Widget Titles Based on Filter Selections in Sisense (Linux) Introduction This article guides how to dynamically change the title of a Sisense widget based on the filter selection. While this is an advanced solution and not natively supported by Sisense functionality, a custom script can be used to achieve this effect. Please proceed with caution, as this is a custom implementation.   [ALT Text: A dashboard display titled "Europe, USA (by Region)" showing a gauge indicating an "Actual Margin" of 0.22. The gauge ranges from -0.25 to 0.25. A sidebar lists regions: Europe, N/A, and USA, with checkboxes next to each.] Step-by-Step Guide Navigate to the desired dashboard in Sisense and select the widget you want to change the title dynamically. Open the widget's settings and access the script editor under the 3 dots menu > Edit Script. Copy and paste the following code into the widget's script editor:     widget.on("render", function () { let title = "by Region"; // Set a default title // Find the specific filter by its column name let filterUsed = dashboard.filters.$$items.find( (filter) => filter.jaql.column === "Region" ); // Determine the filter text or set default let filterText = filterUsed && filterUsed.jaql.filter.members?.length ? filterUsed.jaql.filter.members.join(", ") : "All Regions"; // Flag to prevent multiple updates let isModified = false; if (!isModified) { widget.title = filterText + ' ' + title; isModified = true; } });         Adjust the filter.jaql.column value instead of "Region" in the script to match the actual filter you intend to use. Update the default title instead of  "by Region". Modify the "All Regions" value to be displayed for the “Include All” filter.  Save the changes in the script editor. Apply different filter selections on your dashboard to verify that the widget title updates according to the chosen filters. Troubleshooting and Limitations: Ensure that the filter column specified in the script matches an existing filter on the dashboard. The script works only for filters of include type. For excluding filters the additional logic should be implemented.  Conclusion By following the steps outlined above, you can set up your Sisense widget titles to dynamically update based on filter selections. While this approach offers flexibility, it involves a custom script and requires careful handling, as modifications made this way are outside Sisense's standard support. 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.

      Liliia Kislitsyna
      Liliia KislitsynaAdminPosted 1 year ago • Last reply 11 months ago
      4
               
    • Discussion
      Rafael Ferreira
      • Help and How-To
               
      Rafael Ferreira
      Custom Filtering to allow users to filter for specific zip codes
                       

      Hi DRay​   and friends, I am trying to allow my users to filter for multiple different zip codes, and specific zip codes to their use cases. Right now in Sisense a user would have to search and click the ones they want, I know with custom code filtering then can give the codes they want to filter for. Is there any easier way, maybe BloX, where a user can search/filter for multiple zip codes without looking them up/without using the custom code filter option? example:   {   "explicit": true,   "multiSelection": true,   "members": [     33825,     34420,     33834,     33525,     34432,     32134,     33843,     34690,     34691,     33852,     33810,     34638,     34639,     33549,     33559,     33558,     34652,     34470,     34471,     34472,     34473,     34474,     34475,     34476,     34479,     34480,     34481,     34482,     33556,     32179,     34683,     34684,     33576,     33870,     33872,     33875,     33584,     34488,     34491,     33604,     33605,     33610,     33612,     33613,     33614,     33617,     33618,     33619,     33624,     33625,     33637,     33647,     33603,     33607,     33609,     33615,     33626,     33634,     33635,     34689,     33592,     33873,     33543,     33545,     33544,     33540,     33541,     33542,     33823,     33827,     33830,     34714,     33523,     33837,     33896,     33897,     33838,     33839,     33841,     33844,     33847,     33855,     33849,     34759,     33850,     33851,     33853,     33859,     33898,     33801,     33803,     33805,     33809,     33811,     33812,     33813,     33815,     33854,     33860,     33856,     33868,     33867,     33877,     34787,     33880,     33881,     33884   ] }

      1 year agolast reply 11 months ago
      8