Merge borders for multiple widgets
Hello, I'm trying to merge borders for multiple widgets. Lets say if I have two widgets I know I can customize each widget's border style using the below script ,but is there a way to only have 4 borders for 2 widgets instead of 8. TIA dashboard.on('widgetready', function(sender, ev){ widgetlist = ['5sd2c75601eafb7y02d4bce89', '61r4d1fb65c615646ee3t523'] $.each(widgetlist, function(index, value){ widgetelement = $('[widgetid = "' + value + '"]', element) widgetelement.css('border', '10px solid #000') widgetelement.css('border-radius', '15px') }) })Solved2.8KViews0likes6CommentsUsing BLOX input.toggle element to add additional dropdown menu
Hi there, I have a BLOX widget that I'm using as a controller for a line chart on my dashboard. This BLOX widget is used to change the date granularity as well as change which KPI's are displayed in the below line chart. At a baseline, it works, but I'm actually looking to modify this widget by adding a toggle that when enabled adds another KPI dropdown that the user could then interact with. I've got some screenshots that mock up what I want this to look like, but I'm unable to get this actually working. I'm having a hard time passing the true/false data (true when checked, false when unchecked) to be evaluated by a condition element that is yet to be added. I'm including the configuration for the BLOX widget below as well. The item set I want removed is the 3rd Input.choiceset with the class "togglable" The actual action script seems pretty straightforward once I can have the dropdown added reliably. I appreciate any help, and thank you very much in advanced! { "actions": [], "body": [ { "items": [ { "columns": [ { "items": [ { "style": { "color": "", "font-weight": "bold", "margin": "auto", "padding-left": "20%" }, "text": "Choose a Date Granularity and Performance Metric", "type": "TextBlock", "weight": "regular" } ], "type": "Column" }, { "items": [ { "choices": [ { "title": "Years", "value": "years" }, { "title": "Quarters", "value": "quarters" }, { "title": "Months", "value": "months" }, { "title": "Weeks", "value": "weeks" }, { "title": "Days", "value": "days" } ], "class": "dropDown", "displayType": "compact", "id": "dateGran", "style": { "font-family": "Roboto", "visibility": "visible", "margin": "auto" }, "type": "Input.ChoiceSet", "value": "1" } ], "type": "Column" }, { "items": [ { "choices": [ { "title": "Theo Win Per Unit Per Day", "value": "1" }, { "title": "Actual Win Per Unit Per Day", "value": "2" }, { "title": "Coin In Per Unit Per Day", "value": "3" }, { "title": "Leased Fees Per Unit Per Day", "value": "4" }, { "title": "Net Theo Win Per Unit Per Day", "value": "5" }, { "title": "Net Actual Win Per Unit Per Day", "value": "6" }, { "title": "Theo Win", "value": "7" }, { "title": "Actual Win", "value": "8" }, { "title": "Coin In", "value": "9" }, { "title": "Net Theo Win", "value": "10" }, { "title": "Net Actual Win", "value": "11" }, { "title": "Games Played", "value": "12" }, { "title": "Avg Bet", "value": "13" }, { "title": "Occupancy", "value": "14" }, { "title": "Net Theo Win Index VS Floor", "value": "15" }, { "title": "Net Actual Win Index VS Floor", "value": "16" } ], "class": "dropDown", "displayType": "compact", "id": "KPISwitch", "style": { "font-family": "Roboto", "margin": "auto" }, "type": "Input.ChoiceSet", "value": "1" }, { "choices": [ { "title": "Theo Win Per Unit Per Day", "value": "1" }, { "title": "Actual Win Per Unit Per Day", "value": "2" }, { "title": "Coin In Per Unit Per Day", "value": "3" }, { "title": "Leased Fees Per Unit Per Day", "value": "4" }, { "title": "Net Theo Win Per Unit Per Day", "value": "5" }, { "title": "Net Actual Win Per Unit Per Day", "value": "6" }, { "title": "Theo Win", "value": "7" }, { "title": "Actual Win", "value": "8" }, { "title": "Coin In", "value": "9" }, { "title": "Net Theo Win", "value": "10" }, { "title": "Net Actual Win", "value": "11" }, { "title": "Games Played", "value": "12" }, { "title": "Avg Bet", "value": "13" }, { "title": "Occupancy", "value": "14" }, { "title": "Net Theo Win Index VS Floor", "value": "15" }, { "title": "Net Actual Win Index VS Floor", "value": "16" } ], "class": "dropDown togglable", "displayType": "compact", "id": "KPISwitch", "style": { "font-family": "Roboto", "margin": "auto", "visibility": "visibile" }, "type": "Input.ChoiceSet", "value": "1" } ], "type": "Column" }, { "items": [ { "actions": [ { "title": "Apply", "type": "UpdateData" } ], "style": { "align-self": "", "font-family": "Roboto", "margin": "auto", "padding-left": "" }, "type": "ActionSet" }, { "type": "Input.Toggle", "title": "Compare 2 KPIs", "id": "DualAxisToggle", "style": { "margin": "auto", "font-weight": "bold" }, "valueOn": "false", "valueOff": "true", "value": "true" } ], "type": "Column" } ], "type": "ColumnSet", "width": "" } ], "type": "Container", "width": "" } ], "carouselAnimation": { "showButtons": false }, "script": "$('.dropDown').find('.placeholder').remove().end().prepend('<option class = placeholder value=\"\" disabled selected>Select Filter</option>')", "showCarousel": true, "style": "", "title": "", "titleStyle": [ { "display": "none" } ] }2.1KViews0likes2CommentsHow to find overlapping datetime for two different entries
Hello, I am using a product that is built off of sisense and need to build a script so that I can create a custom function or script that will show all over lapping entries. Below is a sample row from the data I am working with. Incident Number Dispatched Time Cleared Time Unit Number 2024-1000 08/14/2024 07:00 08/14/2024 10:00 M66 2024-1001 08/14/2024 09:30 08/14/2024 12:00 M68 In this case I am hoping to return the data in one dashboard and a count of total number of overlapping incidents based on these two values in the data. In this example there was a second incident that occurred and the first was still in progress. If this was the only overlapping call it should return a count of 1 and the above table. The table columns are already in the dashboard but show all incidents.2KViews0likes8CommentsFlowiseai + Sisense = RAG from a widget data values
flowiseai : https://flowiseai.com/ flowiseai git : https://github.com/FlowiseAI/Flowise Leveraging flowiseai's LLM workflow, I created a custom tool and node.js-based fetch api code to enable augmented analysis and easy querying of data values for Sisense specific widgets with OpenAi GPT4o (You can use any llm including llama3, Anthropic, Huggingface,.... with same workflow). It took about 5 minutes to integrate and implement. code sample start : const fetch = require('node-fetch'); const apikey = 'your-api-key'; const baseUrl = 'https://your-sisense-url'; const dashboardId = $dashboard_id; const widgetId = $widget_id; const getWidgetMetadata = async () => { const url = `${baseUrl}/api/v1/dashboards/${dashboardId}/widgets/${widgetId}`; const options = { method: 'GET', headers: { 'Authorization': `Bearer ${apikey}`, 'Content-Type': 'application/json' } }; try { const response = await fetch(url, options); if (!response.ok) { throw new Error(`Error fetching widget metadata: ${response.statusText}`); } const metadata = await response.json(); console.log('Widget Metadata:', JSON.stringify(metadata, null, 2)); return metadata; } catch (error) { return `Error in getWidgetMetadata: ${error.message}`; } }; const getJaql = (widgetStructure) => { const result = []; for (const panel of widgetStructure.metadata.panels) { for (const item of panel.items) { if (item && item.jaql) { result.push(item.jaql); } } } const payload = { datasource: widgetStructure.datasource, metadata: result }; console.log('Generated JAQL Payload:', JSON.stringify(payload, null, 2)); return JSON.stringify(payload); }; const getWidgetChartData = async (jaqlQuery) => { try { const parsedJaqlQuery = JSON.parse(jaqlQuery); if (!parsedJaqlQuery.datasource || !parsedJaqlQuery.datasource.title) { throw new Error('Datasource title is missing in JAQL query'); } const jaqlUrl = `${baseUrl}/api/datasources/${parsedJaqlQuery.datasource.title}/jaql`; console.log(`JAQL URL: ${jaqlUrl}`); console.log(`JAQL Query: ${JSON.stringify(parsedJaqlQuery, null, 2)}`); const jaqlOptions = { method: 'POST', headers: { 'Authorization': `Bearer ${apikey}`, 'Content-Type': 'application/json' }, body: jaqlQuery }; const response = await fetch(jaqlUrl, jaqlOptions); if (!response.ok) { throw new Error(`Error fetching widget chart data: ${response.statusText}`); } const chartData = await response.json(); console.log('Widget Chart Data:', JSON.stringify(chartData, null, 2)); return chartData; } catch (error) { return `Error in getWidgetChartData: ${error.message}`; } }; const fetchWidgetData = async () => { try { const widgetDefinition = await getWidgetMetadata(); if (typeof widgetDefinition === 'string' && widgetDefinition.startsWith('Error')) { return widgetDefinition; } : code sample end dashboards/61bfddcd53ccb90035ce1626/widgets/61bfddcd53ccb90035ce1631 is basic prompt style : dashboards/61bfddcd53ccb90035ce1626/widgets/61bfddcd53ccb90035ce1631 Analyze widget data value gpt-4o response : GPT 4o generated text through RAG from sisense rest api: The analysis of the widget data values from the dashboard 61bfddcd53ccb90035ce1626 and widget 61bfddcd53ccb90035ce1631 is as follows: Headers: Mall Region - Represents the regions or countries where the malls are located. Product Selling Codes - Represents the number of product selling codes in each region. Top 10 Regions by Product Selling Codes: Indonesia: 15,317 product selling codes Viet Nam: 7,241 product selling codes Philippines: 6,494 product selling codes Malaysia: 4,369 product selling codes Singapore: 3,151 product selling codes South Korea: 2,447 product selling codes Thailand: 1,683 product selling codes Russia: 1,647 product selling codes Japan: 1,608 product selling codes United States: 1,048 product selling codes Insights: Indonesia leads with the highest number of product selling codes at 15,317. Viet Nam and Philippines follow with 7,241 and 6,494 product selling codes, respectively. Malaysia and Singapore also have a significant number of product selling codes, with 4,369 and 3,151, respectively. South Korea, Thailand, Russia, Japan, and United States round out the top 10 with over 1,000 product selling codes each. Summary: The data indicates a high concentration of product selling codes in Southeast Asia, especially in Indonesia, Viet Nam, and the Philippines, suggesting robust market activity in those regions. The presence of significant numbers in countries like Japan, Russia, and the United States also highlights strong market participation there. Data Table: Mall Region Product Selling Codes Croatia 5 Myanmar 10 Azerbaijan 15 Hungary 15 Italy 20 Romania 21 Nepal 21 Chile 22 Slovakia 23 Pakistan 24 Estonia 25 Mauritius 26 Lebanon 37 Nigeria 38 Lithuania 41 Bangladesh 42 Kenya 42 France 49 Spain 50 United Arab Emirates 54 South Africa 57 Switzerland 68 Mexico 80 Denmark 86 Finland 107 Canada 117 Saudi Arabia 132 Hong Kong China 148 China 180 Sweden 190 Germany 199 Norway 224 Australia 242 Ukraine 269 Poland 296 United Kingdom 298 Turkey 307 India 542 Taiwan China 583 United States 1048 Japan 1608 Russia 1647 Thailand 1683 South Korea 2447 Singapore 3151 Malaysia 4369 Philippines 6494 Viet Nam 7241 Indonesia 15317 This data can help identify key regions for potential business expansion and investment opportunities in different markets. *next work will be RAG with Sisense Dashboard including multi widegts1.9KViews1like1CommentWidget Display Not Updating On Dashboard Filter Change
Hi all, So I am running the following script on my widget (using 'edit script') in order to grab the date of the maximum dollars for a year using a different bar chart widget on the dashboard, and display that date (along with the $ amount) on an indicator widget var dateStr = ''; widget.on('processresult', function(e,v) { var results = widget.queryResult; console.log(results); var maxNum = results.value.data; var replaceNum = results.secondary.data; //var dateStr = ''; console.log(results); var widg = dashboard.widgets.get('6633bbf55a7e230040304e8c'); var widgResult = widg.rawQueryResult.values; console.log(widgResult); $.each(widgResult, function(index, item) { let date = item[0].data; let amt = item[1].data; if (amt === maxNum) { dateStr = date; }; }); //results.secondary.data = dateStr.substring(0, 10); //results.secondary.text = dateStr.substring(0,10); }); widget.on('render', function(se, ev) { var results = widget.queryResult; results.secondary.data = dateStr.substring(0, 10); results.secondary.text = dateStr.substring(0,10); }); widget.refresh(); This works, and gets me the proper date. However, when I open the dashboard (/refresh the page), or change filters, the displayed date doesn't update, and only updates when I do something like changing the widget's width on the dashboard manually, as though I am manually refreshing the widget's render state or something. Can anyone help me with a solution so that the widget properly displays the info without having to manually change its size to refresh the display? Thanks in advanceSolved1.9KViews0likes3CommentsCustomize No Results Layout
Hello All, Is there a way to customize "No Results" layout, we have few buttons at the top being hidden when widget has no data. Also adding the html script we're using. TIA const dropdownWrapperHTML = ` <div class="dropdown-wrapper-${w.oid} ${dimname}-dropdown" style="position: relative; display: inline-block; width: 100%; max-width: fit-content;"> <label for="productDropdown-${w.oid}" style="cursor: pointer; margin-left: 21px; font-size: 12px; color: #007BFF;"> Product <span style="font-size: 10px; transition: transform 0.2s;">▼</span> </label> <span id="selectedProduct-${w.oid}" style="font-size: 12px; margin-left: 8px; color: #007BFF;">(None)</span> <div class="dd-container-${w.oid}" style="position: absolute; top: 100%; left: 0; z-index: 1000; background: #FFFFFF; border: 1px solid #E0E0E0; border-radius: 8px; display: none; padding: 10px; box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);"> <input type="text" id="dropdown-search-${w.oid}" placeholder="Search products..." style="width: 100%; padding: 8px; margin-bottom: 5px; font-size: 12px; border: 1px solid #E0E0E0; border-radius: 4px;"> <div id="radioContainer-${w.oid}" style="max-height: 200px; overflow-y: auto;"></div> </div> </div> `;Solved1.6KViews0likes6CommentsWidget Data Not Included in Downloaded CSV After Calculation (Table Widget)
Hey all, I'm using a script to calculate a total value, and inserting said value, into a table widget. It sums up the quantity column, and presents that sum in the last cell of the column. This displays information correctly, and works as a widget. However, when I go to download the csv of the widget, the file doesn't include the calculated value, it's empty (which is what it is before the value is replaced). If I download as PDF or Image, the calculated value is included. Does anyone have a solution/fix so that the table includes the value when downloaded as csv? I imagine that this is happening due to where/when the data is being replaced. Thanks in advance. widget.on('processresult', function(widget, query) { var results = query.result.rows(); var total = 0; $.each(results, function(i, row) { if (i < results.length - 1) { total += row[5].data; } }); var lastRow = results[results.length - 1]; lastRow[4].data = total; });Solved1.6KViews0likes2CommentsCreating a hyperlink in widget title; having it show in editing and viewer mode
I am using this script to create a hyperlink in a widget title but the hyperlink only shows in editing mode and not in the viewer mode. Trying to see what I can do to have this show in viewer mode as well. widget.on('refreshed', () => { const titleElement = element.parent().find('.transput-holder'); if (!titleElement) return; titleElement.empty(); titleElement.append('<a href="https://website.com" target="_blank" >MSI Info</a>'); if (!widget.dashboard.editing) { titleElement.parent().show(); } }) This is what I see in editing mode and viewer mode: DRay harikm007Solved1.4KViews0likes1CommentConfiguring B2D in Snowflake
Hello everyone, We currently use live connections (not elasticube) to Snowflake to build our data models. I have few questions on B2D - Our source and destination is Snowflake, so can we skip AWS S3 part? - Is there a way to use Azure Blob instead of AWS S3 ? - Is it a one time admin setup or does every developers needs to configure it for each B2D model? - Does B2D respect connection parameters? eg: we use database parameter in our connection settings to ensure each client connects to their own database. So if we configure B2D, does Sisense ensure that the 'destination' is respecting that 'database parameter' that we have configured? - Is there any high level video/article that explains B2D better?1.2KViews0likes3Comments