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
    Typescript
      • Help and How-ToChevronRightIcon
                       
      Compose SDK schema not as type safe as initially thought
      cristinecula
      cristinecula
      Posted 1 year ago • Last reply 1 year ago
      4
               
    • ssalazar1
      • Help and How-To
               
      ssalazar1
      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.

      1 year agolast reply 1 year ago
      2
               
      • Help and How-ToChevronRightIcon
                       
      Use of 'beforeRender' inside Table?
      IsaacBlanco
      IsaacBlanco
      Posted 1 year ago • Last reply 1 year ago
      3
               
      • Embedding AnalyticsChevronRightIcon

      Supercharging Your Tabular Views: AG Grid Powered by Sisense Compose SDK

                                               

      Supercharging Your Tabular Views: AG Grid Powered by Sisense Compose SDK   How to Build a Tabular View with Sisense Compose SDK and AG Grid   This guide walks through how to use Sisense Compose SDK's query hooks to power an AG Grid table component in React. We'll break down the steps, explain the code, and highlight the key functionalities of AG Grid. Introduction Tables are essential in BI applications for summarizing large datasets and providing users with a simple way to navigate, filter, and analyze data. AG Grid is an ideal solution for tabular views, offering robust capabilities like sorting, filtering, grouping, and data exporting. When combined with the Sisense Compose SDK, you can power real-time, data-driven applications that provide users with seamless, customizable data interactions. In this example, we are using a sample eCommerce dataset, available through the Sisense Compose SDK free trial, to demonstrate how powerful this combination can be. Users can explore product sales by country, age range, and time period in a fully interactive grid. AG Grid's advanced tabular capabilities include features like multi-level row grouping, custom value formatting, pivot mode for creating complex data hierarchies, and the ability to export data to formats like CSV. These features, when integrated with Sisense's query hooks and real-time data, enable developers to create highly dynamic dashboards where users can manipulate large datasets with ease. This combination of Sisense Compose SDK and AG Grid empowers developers to create rich, interactive data experiences, allowing users to filter and manipulate data at granular levels, all while leveraging real-time querying powered by Sisense. Step-by-Step Breakdown of the Code Setting Up the Project packages used: npm install ag-grid-react ag-grid-community @mui/material @sisense/sdk-ui @sisense/sdk-data   Register AG Grid Modules AG Grid uses modules to enable functionality like client-side row models, and sorting and filtering. We register the modules to be used within AG Grid: import { AgGridReact } from "ag-grid-react"; import "ag-grid-community/styles/ag-grid.css"; import "ag-grid-community/styles/ag-theme-alpine.css";   These imports ensure that AG Grid is properly styled and functional. Setting Up the Query with Sisense SDK Sisense Compose SDK’s `useExecuteQuery` is used to fetch data from your data sources. The query can include dimensions and measures which AG Grid will render.   const queryProps = useMemo(() => ({ dataSource: DM.DataSource, dimensions: [DM.Country.Country, DM.Commerce.AgeRange, DM.Commerce.Date.Years], measures: [ measureFactory.sum(DM.Commerce.Revenue, "Total Revenue"), measureFactory.sum(DM.Commerce.Quantity, "Total Quantity"), ], }), []);   Here, `useExecuteQuery` executes the query based on the defined data source (`DM.DataSource`), dimensions (e.g., country, age range), and measures (e.g., revenue, quantity). Fetching and Displaying Data We leverage React's `useEffect` hook to update the state of `rowData` once data is fetched. This ensures AG Grid displays up-to-date information.   const { data, isLoading, isError } = useExecuteQuery(queryProps); useEffect(() => { if (!isLoading && !isError && data) { const rows = data.rows.map((row) => ({ country: row[0]?.text || "N/A", ageRange: row[1]?.text || "N/A", year: row[2]?.text || "N/A", revenue: row[3]?.data || 0, quantity: row[4]?.data || 0, })); setRowData(rows); } }, [data, isLoading, isError]);   This block processes the raw data returned from the query and formats it for use in the AG Grid. Column Definitions AG Grid requires column definitions that define how each field should be displayed.   const columnDefs = useMemo(() => [ { field: "country", headerName: "Country" }, { field: "ageRange", headerName: "Age Range" }, { field: "year", headerName: "Year" }, { field: "revenue", headerName: "Total Revenue", valueFormatter: (params) => abbreviateNumber(params.value), // Helper function for number formatting }, { field: "quantity", headerName: "Total Quantity", valueFormatter: (params) => abbreviateNumber(params.value), }, ], []);   We define five columns: country, age range, year, revenue, and quantity. The `valueFormatter` function ensures that numbers are displayed in an abbreviated format (e.g., "1.2K" for thousands). AG Grid Configuration The grid configuration includes `defaultColDef` for common properties across all columns (like filtering and sorting), and `animateRows` for smoother transitions.   const defaultColDef = useMemo(() => ({ flex: 1, minWidth: 100, sortable: true, filter: true, resizable: true, }), []);   Here, all columns are set to be sortable, filterable, and resizable by default. Exporting Data AG Grid’s API allows exporting table data to CSV. We use a button to trigger the export functionality:   const onBtnExport = useCallback(() => { gridRef.current.api.exportDataAsCsv(); }, []);   Rendering the Grid Finally, we render the AG Grid component, passing the `rowData`, `columnDefs`, and `defaultColDef` as props:   <AgGridReact ref={gridRef} rowData={rowData} columnDefs={columnDefs} defaultColDef={defaultColDef} animateRows={true} />   This sets up the AG Grid to dynamically render data retrieved via Sisense Compose SDK. Value of Tabular Views Tabular views are crucial for presenting structured data, providing an easy way to explore, filter, and analyze datasets. AG Grid’s built-in features like sorting, filtering, and exporting make it a perfect fit for visualizing data-rich tables in BI environments. Features of AG Grid - Sorting and Filtering: Users can sort and filter data by column. - Grouping: Group rows by common fields. - Customization: Full flexibility in column definitions and row configurations. - Exporting: Allows exporting table data to CSV format. - Performance: Handles large datasets efficiently. Using Sisense Compose SDK to Power Components Sisense Compose SDK is an API-first approach to data querying, which powers the `useExecuteQuery` hook in this component. By combining it with AG Grid, you can easily visualize dynamic, real-time data in table format. Here is a functional example in Github  https://github.com/sisensers/ag-grid-compose-sdk.git

      Sisense User
      Sisense UserPosted 1 year ago
      0
               
      • Embedding AnalyticsChevronRightIcon

      Using Compose SDK with D3 Packed Bubble Charts

                                       

      Using Compose SDK with D3 Packed Bubble Charts How to Build a Packed Bubble Chart Using D3.js and the Sisense Compose SDK D3 Packed Bubble Git Repo   What Is D3.js? D3.js (Data-Driven Documents) is a popular JavaScript library used to create complex, data-driven visualizations in the web browser. D3 allows developers to bind data to a Document Object Model (DOM) and apply transformations to the data using SVG, HTML, and CSS. Its flexibility makes it the go-to library for building everything from bar charts to complex network diagrams. Why Use D3.js? - Customizability: You have full control over how elements are drawn and interact on the page. - Scalability: D3 can handle large datasets efficiently and supports dynamic updates as data changes. - Community: It has a robust ecosystem and large  developer community. What Is Sisense Compose SDK? Sisense Compose SDK is a powerful developer toolkit that compartmentalizes Sisense's APIs into JavaScript packages, allowing developers to build custom data products within their preferred IDE. With the Compose SDK, developers can embed pre-existing Sisense Fusion Embed charts or build custom visualizations from the ground up using query and chart components. This flexibility empowers developers to integrate custom chart libraries powered by Sisense, all while adhering to the platform's robust data security protocols. The SDK enables seamless interaction with Sisense's data layer, allowing you to query data, execute complex analytics workflows, and retrieve results programmatically, making it an essential tool for embedding advanced analytics into your applications. Why Use the Sisense Compose SDK? -   Flexibility: You can embed pre-existing Sisense Fusion Embed charts or build fully custom visualizations using your preferred tools, such as D3.js. The SDK provides the flexibility to create tailor-made analytics experiences that fit your unique requirements. -   Customization: Developers can leverage the SDK to execute, filter, and transform data, and even power custom chart libraries like D3.js, while still ensuring that Sisense’s data security protocols are adhered to. The SDK also allows for building visualizations from the ground up, giving you full control over every aspect of the charting process. Integrating D3.js with the Sisense Compose SDK In this tutorial, we’ll walk through how to combine the strengths of D3.js for visualization with the Sisense Compose SDK for querying and managing data, allowing you to build a packed bubble chart that is both highly customizable and secure. Setting Up the Project First, you need to install the required dependencies: ```bash npm install react react-dom npm install d3 npm install @sisense/sdk-ui @sisense/sdk-data ``` You’ll also need to set up a `.env` file with your Sisense instance URL and API Token: ```bash REACT_APP_SISENSE_INSTANCE_URL=https://your-sisense-instance-url.com REACT_APP_SISENSE_API_TOKEN=your-api-token ``` These variables will be used to authenticate with your Sisense instance. Querying Data with Sisense Compose SDK The Sisense Compose SDK allows you to query your data models directly. Here’s an example of querying for age range, total cost, and total revenue: ``` const { data, isLoading, isError } = useExecuteQuery({ dataSource: DM.DataSource, dimensions: [DM.Commerce.AgeRange], measures: [ measureFactory.sum(DM.Commerce.Cost, 'Total Cost'), measureFactory.sum(DM.Commerce.Revenue, 'Total Revenue'), ], }); ``` This query fetches the age range of customers, along with the total cost and total revenue for each age group. The `useExecuteQuery` hook makes it easy to execute the query and retrieve the results. Visualizing Data with D3.js Once the data is fetched, we can map it to D3.js to visualize it as a packed bubble chart: ``` const bubbleData = data.rows.map(row => ({ ageRange: row[0].data, totalCost: row[1].data ?? 0, totalRevenue: row[2].data ?? 0, })); // Define the bubble chart using D3 svg.selectAll('circle') .data(bubbleData) .enter() .append('circle') .attr('cx', d => xScale(d.ageRange)) .attr('cy', d => yScale(d.totalRevenue)) .attr('r', d => radiusScale(d.totalCost)) .attr('fill', 'steelblue') .attr('opacity', 0.7); ``` Here, `xScale` and `yScale` are used to position the bubbles, and `radiusScale` controls the size of the bubbles based on the `totalCost`. Each bubble represents an age range, and its size reflects the total cost associated with that range. Enhancing the User Experience By leveraging the Sisense Compose SDK and D3.js, you can build highly interactive and customizable visualizations. This packed bubble chart will resize and reposition the bubbles in real-time as new data is queried or filters are applied. You can further extend this by adding hover tooltips, click events, or dynamic filters using D3.js transitions. Conclusion Combining D3.js with the Sisense Compose SDK allows you to create dynamic, real-time data visualizations that not only look great but also provide meaningful insights. This packed bubble chart offers a visually compelling way to represent comparative data, such as cost and revenue across different age groups. Whether you’re building dashboards or embedding analytics into a product, this integration delivers powerful visualizations tailored to your needs. If you’re not already using Sisense, try it out with their free trial   here .

      Sisense User
      Sisense UserPosted 1 year ago
      0
               
    • enmiwong
      • Help and How-To
               
      enmiwong
      Applied JAQL formula on top of another JAQL formula result
                                       

      Hi, I have applied a JAQL formula to get new values (the values * 10), after that, I want to get the MAX from the result of the first query. how to achieve that? this is the result get from JAQL :  [{"data": 4.3,"text": "4.3"}, {"data": 1,"text": "1"}, {"data": 43,"text": "43"}] the third column is get by applied this JAQL formula:  { "jaql": { "context": { "[sepal_length]": {"dim": "[irisdataset6.sepal_length]"} }, "formula": "10 * MAX([sepal_length]) + 0", "title": "transform_x" } } now I want to get the max from the third column, how to achieve that?

      1 year agolast reply 1 year ago
      5
               
    • Padrickk
      • Help and How-To
               
      Padrickk
      I need some guidance as in what category should I post into?
                               

      Hello there, This is my first post after just joining this discussion, so please forgive me and provide kind assistance if I have posted to the wrong subsection. I am new here but a real enthusiast and loving this community so far. I have a background in teaching coding and in education and feel I could help with documentation, at least for starters. As a new member in this forum and wish to share and gain some knowledge. I am looking forward to create my own discussion to resolve my query and gain some knowledge though I have taken part in various discussion which is definitely helped me a lot. Also in what category should be taken depends on what factors? Thank you in advance.  

      1 year agolast reply 1 year ago
      2
               
    • khawkins
      • Help and How-To
               
      khawkins
      Inactivity Timeout with iFrame Dashboard
                               

      I'm working on an Angular/Spring application that embeds Sisense dashboards in iFrames. I'm trying to add an inactivity timeout for the application, so that users are signed out after a certain period of inactivity. However, I'm not sure how to detect user activity on the dashboards, sense they are rendered within an iFrame. What options are available for handling this functionality?

      2 years agolast reply 1 year ago
      4
               
      • Help and How-ToChevronRightIcon
                       
      Compose SDK mock data
      IsaacBlanco
      IsaacBlanco
      Posted 2 years ago • Last reply 2 years ago
      2
               
      • Embedding AnalyticsChevronRightIcon

      React Typescript Component for Embedding Sisense Dashboards

                                               

      To embed dashboards from Sisense into your web application, typically you would use either the IFRAME or EmbedSDK approaches (see sisense.dev for more details). If your application is written in React , then React components to achieve tasks, like this, make life easier. You can always write your own components around Sisense SDKs and APIs, but here is one I wrote that you can use to get started. Example Application To see the component working in a live sample application, simply visit this link and enter your Sisense URL and dashboard ID into the relevant input boxes.     To download the source of this example application, clone this repo and follow the instructions on the readme page.   Use the React Component in Your Application To see more details on how to use the React Component for Sisense Embed SDK in your application, visit the repo for the component and follow the instructions on the read me. At the time of writing this article, here is all you should need to do: Install module using npm npm install --save sisensers/sisense-embedsdk-react   Import the module into your React application import SisenseDashboardEmbed from 'sisense-embedsdk-react'   Use the `SisenseDashboardEmbed` component on your page <SisenseDashboardEmbed<br/> sisenseUrl={sisenseUrl}<br/> dashboardId={dashboardId}<br/>/>   The component accepts a number of other optional 'props', including Booleans, to control the dashboard settings (toolbar, left pane, right pane), volatile mode (don't save changes to dashboard state), as well as strings for the look and feel theme, css height/width for rendered frame etc. Also, you can control if things like EmbedSDK should be unloaded when the component unmounts through the props, as well as attach your own handler to execute when the dashboard has loaded. I hope this helps some of you get started with using Sisense in React! Leave a comment if you use my example and share your experience. 

      steve
      stevePosted 3 years ago • Last reply 2 years ago
      5