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
      • Official Sisense Discord
    • Use Case Gallery
    •      
    Discussions
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
    Discussions
    • TagsChevronRightIcon
    How-To
    • Mia Isaacson

      Help and How-To

               
      Mia Isaacson
      Posted 1 month ago
      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

                                             
      0
               
    • Mia Isaacson

      Help and How-To

               
      Mia Isaacson
      Posted 1 month ago
      Widget script: hide value labels and empty legend items on native bar and column charts
                                                       

      Hey everyone 👋 Ever built a stacked bar or column chart and found yourself wishing you could just... turn the labels off? Maybe you've got a lot of segments, and they're all squishing together, or the chart just doesn't have quite enough room to breathe in your dashboard layout, and the labels end up overlapping and making things harder to read rather than easier. Or, does it bother you that your legend still shows entries for categories that have no data at all for certain dimension values? So you've got these ghost entries sitting in the legend that don't correspond to anything visible in the chart. Sisense doesn't have a native toggle for either of these, so here's a widget script that handles both. It works on bar and column charts (stacked or single value) and does two things: Hides the value labels from displaying on the bars or columns Removes any series from the legend if all of its values are null or zero widget.on("beforeviewloaded", function(w, args){ var allEmpty = arr => arr.every(v => v.y === null || v.y === 0); for (e in args.options.series) { var serie = args.options.series[e]; if (allEmpty(serie.data)) { serie.showInLegend = false; } } }); A few situations where this comes in handy: You have a stacked chart with a lot of segments where the labels are colliding with each other Your dashboard is on the tighter side, and there just isn't room to make the chart large enough for labels to display cleanly Your legend is cluttered with entries for categories that have no data for certain dimension values, which can confuse users into thinking something is missing The chart is more of a visual overview and the exact values aren't the point, users can always hover for tooltips anyway You just prefer a cleaner, less noisy look overall Nothing groundbreaking, just a handy little script if you've ever hit this wall.  Mia from QBeeQ, a Sisense Gold Implementation Partner www.qbeeq.io

                                             
      0
               
    • Rose Holmes-Minton

      Help and How-To

               
      Rose Holmes-Minton
      Posted 3 months ago • Last reply 3 months ago
      Set a background dashboard filter using Javascript
                               

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

                                             
      3
               
    • BenWalkerRH

      Help and How-To

               
      BenWalkerRH
      Posted 7 months ago • Last reply 6 months ago
      Dynamically changing colours on value labels
                               

      Does anyone know if this if possible either at a widget level AND/OR at a dashboard level? I've tried a bunch of scripts from ChatGPT but none that work as intended.  They either amend the colours but dont respect and changes being mad to rendering such as cell size changes and filters applied etc, or the reverse where it respects the rendering but not the colours changing.. 

                                             
      5
               
    • kamal123

      Help and How-To

               
      kamal123
      Posted 8 months ago • Last reply 8 months ago
      Kamal Hinduja Swiss: How to use REST APIs to push data into Sisense?
                                       

      Hi All, I'm Kamal Hinduja, based in Geneva, Switzerland(Swiss) .  Can anyone explain in details How to use REST APIs to push data into Sisense? Thanks, Regards Kamal Hinduja Geneva, Switzerland  

                                             
      4
               
    • Michalis Gregoriou

      Help and How-To

               
      Michalis Gregoriou
      Posted 11 months ago • Last reply 10 months ago
      Webhooks on MS Teams
                       

      Hi Community, Has anyone managed to setup a Webhook on MS Teams? I am trying to set it up, but it doesn't seem to work... 

                                             
      3
               
    • ssalazar1

      Help and How-To

               
      ssalazar1
      Posted 1 year ago • Last reply 1 year ago
      imply Ask Save Function Not Working in Embed SDK Implementation
                                       

      Hi, I'm working with Sisense's Embed SDK (not iFrame or SisenseJS) implementation and I've encountered a specific issue with the Simply Ask feature. The Simply Ask button is visible and functional in my embedded dashboard, but I'm unable to save any queries created through it. Here's my current implementation: typescriptCopyconst sisenseFrame = new SisenseFrame({ url: ' https://dvunified1.sisense.com/ ', dashboard: { id: '65118b631a4ea600334e0e7e', settings: { toolbarEnabled: true, toolbarShowDashboards: true, navigation: true } }, settings: { showHeader: true, showLeftPane: true, showRightPane: true, showToolbar: true }, element: document.getElementById('sisense-iframe') }); The interesting part is that: The Simply Ask button appears and works correctly I can create queries and see results However, when trying to save a query, nothing happens I've verified that: I'm using the latest version of Embed SDK The JWT token includes necessary permissions Simply Ask is enabled in the Sisense admin panel The implementation follows the SDK documentation guidelines Is there any specific configuration or permission needed for the save functionality in Simply Ask when using Embed SDK? Or could this be related to the 'volatile' mode setting? Any guidance would be greatly appreciated.

                                             
      2
               
    • genkiseow

      Help and How-To

               
      genkiseow
      Posted 1 year ago • Last reply 1 year ago
      How to login Sisense with admin ID after onboarded to Azure?
               

      During the installation and minimal 2 IDs will be created under Administrator group. However, after onboarded to Azure and Admin has no way to login using the 2 IDs since these 2 IDs are not exist in Azure. Any dedicated login page available in Sisense to enable Admin login?

                                             
      10
               
    • ducnv_resolve

      Help and How-To

               
      ducnv_resolve
      Posted 1 year ago • Last reply 1 year ago
      How to hide environment variables when putting configuration file in plugin folder
                               

      I am using Mapbox to create a new widget and add it as an add-on. I noticed that by placing the entire source code in the /plugins directory (including the file containing environment variables - config.js), anyone can access my token and source code. How can I prevent this from happening?

                                             
      3
               
    • herajapakse

      Help and How-To

               
      herajapakse
      Posted 1 year ago • Last reply 1 year ago
      Retrieving total count and paginating large datasets with Compose SDK
                               

      I'm currently working on implementing a custom table to handle a large dataset in Sisense, and I'm encountering some performance challenges related to pagination. Here's the scenario I'm facing: Requirements: Retrieve the total number of records that match a filter condition (to get the total count for display and pagination). Efficiently paginate the results by fetching only the records for the current page, based on page size (e.g., 10, 25, 50 records per page), without retrieving all records at once. The Challenge: While I can use offset and count to paginate the records and fetch only the records for the current page, I don't have a way to determine the total number of records that match the filter condition without retrieving all of the records first. For large datasets, fetching the entire dataset before pagination is causing performance issues, since Sisense retrieves all the records matching the filter condition before applying pagination, which is inefficient. What I'm Looking For: Is there a way to retrieve the total count of records matching the filter condition without fetching the full dataset? How can I fetch only the records for the current page (using offset and count), while still being able to display the total number of matching records? Does anyone has experience implementing efficient pagination in Sisense for large datasets or can share any best practices, examples, or solutions?

                                             
      4