Calculate the Average for the indicator as on the pivot with the filter
Learn how to accurately calculate the average value for your indicator widget using the AVG formula. This guide highlights how to achieve consistent results, even when applying filters for Marks. Discover the correct formula— avg([student], [Average mark]) —to ensure you get the expected outcomes, with [student] representing all items and [Average mark] reflecting the average of Mark values. Perfect for data analysts seeking reliable insights!568Views1like0CommentsDisable the functionality that allows users to click on the legend in the widget to filter data
To disable the legend-click filtering in your widget, open your dashboard, edit the widget, and access the script editor by clicking the three dots in the top-right corner. Paste the provided code into the editor, save your changes, and the legend will no longer be clickable for filtering data.285Views0likes0CommentsAnalyze SQL Query vs Visualize JAQL
Answer to the question: What is the "Analyze SQL Query" section of the widget for? I can see its SQL however there are no recommendations or visualizations to show the execution or how to improve the query. There used to be a visualizer for the JAQL but that seems to be removed. Does anyone know if it is being replaced?591Views0likes0CommentsSelectively Hide Widget Toolbar Buttons
Selectively Hide Widget Toolbar Buttons The widget script below shows a list of buttons that are available on a widget toolbar and how to hide each of them, so you can choose which ones you want to hide for any particular widget. Note that if you hide the Edit button, as the owner of the dashboard, the only way for you to open and edit the widget is to have the direct URL to the widget. If you want to hide the button(s) only for viewers (so you can still see all the buttons as the owner/designer), uncomment the code that checks the user's role (see comments in the code below). /** This is the widget script to selectively hide widget toolbar buttons **/ //Hide widget toolbar options widget.on('buildquery', ()=> { //Uncomment the code below if you want to hide the buttons only for viewers //if(prism.user.roleName == 'consumer') { //Hide Edit (pencil) button $(element).parent().find('.widget-toolbar-btn--edit').remove(); //Hide Expand / Full Screen (diagonal double-headed arrow) button $(element).parent().find('.widget-toolbar-btn--fullscreen').remove(); //Hide Detail (circled i) button $(element).parent().find('.btn--no-background').remove(); //Hide Menu (vertical ellipsis) button $(element).parent().find('.widget-toolbar-btn--menu').remove(); //Hide Analyze It (graduation owl) button $(element).parent().find('.analyze-it-button').remove(); //Uncomment the closing curly bracket below if you want to hide the buttons only for viewers //} })1.4KViews1like3CommentsTo display a solid line on the chart without using the "Display missing values as zeros" function
To display a solid line on the chart without using the "Display missing values as zeros" function Sometimes there is a need to display a solid line on the chart without using the "Display missing values as zeros" function. Here is a widget script that will read the average value between two neighboring points and draw a line. widget.on('processresult', function(widget, result) { const series = result.result.series; for (let j = 0; j < series.length; j++) { const data = series[j].data; for (let i = 0; i < data.length; i++) { if (data[i].y === null) { let leftIndex = i - 1; let rightIndex = i + 1; while (leftIndex >= 0 && data[leftIndex].y === null) { leftIndex--; } while (rightIndex < data.length && data[rightIndex].y === null) { rightIndex++; } const leftValue = leftIndex >= 0 ? data[leftIndex].y : null; const rightValue = rightIndex < data.length ? data[rightIndex].y : null; if (leftValue === null && rightValue === null) { data[i].y = 0; // You can change this default value } else { const average = ((leftValue || 0) + (rightValue || 0)) / 2; data[i].y = average; } } } } }); Before: After: Leave a comment if this helped or if you need further assistance! Disclaimer: This blog post contains one possible custom workaround solution for users with similar use cases. We cannot guarantee that the custom code solution described in this post will work in every scenario or with every Sisense software version. As such, we strongly advise users to test solutions in their environment before deploying them to ensure that the solutions proffered function as desired. To avoid doubt, the content of this blog post is provided to you "as-is" and without warranty of any kind, express, implied, or otherwise, including without limitation any warranty of security and or fitness for a particular purpose. The workaround solution described in this post incorporates custom coding, which is outside the Sisense product development environment and is, therefore, not covered by Sisense warranty and support services.2.1KViews0likes0Comments