Introduction: Helical Insight metadata connects with a database which is predefined. Now there might be certain cases in which we would like the metadata to connect to different data sources based on certain condition, for example, different organization etc. Here we have explained how the metadata is connected to different data sources based on logged in organization or user.

Prerequisite: Database schema for all the databases must be the same. In this case, we have assumed that the logged in user or organization name is also the name of the database.
Please follow the below steps for dynamic DB switching

  1. Create an EFWD file at the following location:  \hi\hi-repository
  2. From 4.0 onwards, we have 2 options to create database connections:

    1. Managed Groovy JDBC Connection – supports connection pooling and ideally this approach is more preferrable as compared to plain groovy jdbc.
    2. Groovy Plain JDBC Connection
    3. Either of the 2 options can be used.

      First thing to do is go to the location “..\hi\hi-repository” and create a new folder here from the backend. Then you have to create an EFWD file and save it in this newly created folder. On the next steps EFWD file content is specified. The idea of creating it from the backend is so that the folder is public (and thus the created EFWD file is public) and it does not explicitly require sharing.


    1. Managed Groovy JDBC Connection – If you want to use Managed Groovy JDBC Connection, add the below code in the EFWD file.
    2. <EFWD>
      <DataSources>
      <Connection id="1" type="sql.jdbc.groovy.managed">
      <Driver>dynamicSwitch</Driver>
      <Condition>
      
      <![CDATA[
      import groovy.sql.Sql;
      import net.sf.json.JSONObject;
      import com.helicalinsight.adhoc.metadata.GroovyUsersSession;
      public JSONObject evalCondition() {
      JSONObject responseJson = new JSONObject();
      String profileValue = GroovyUsersSession.getValue('${profile[\'ConnectionID\']}');
      profileValue = profileValue.replaceAll("'","");
      
      int globalid = profileValue.toInteger()
      
      responseJson.put("globalId", globalid);
      
      responseJson.put("type","global.jdbc");
      return responseJson;
      }
      ]]>
      
      </Condition>
      </Connection>
      </DataSources>
      </EFWD>
      
    3. If you want to use Groovy Plain JDBC Connection, add the below code to the EFWD file.
    <EFWD>
    <DataSources>
    <Connection id="6" type="sql.jdbc.groovy">    //connectionid can be any number
    <Driver>com.mysql.jdbc.Driver</Driver>		  
    <Url>jdbc:mysql://192.168.2.94:3306/SampleTravelData</Url>  //URL will change according to connection string of your database, you can also pass additional parameters for SSL in this URL
    <User>root</User>      //database user name
    <Pass>root</Pass>		//database password
    	<Condition>
    	<![CDATA[
    	      import groovy.sql.Sql;
    	      import net.sf.json.JSONObject;
    	      import com.helicalinsight.adhoc.metadata.GroovyUsersSession;
    	      public JSONObject evalCondition() {
    		JSONObject responseJson = new JSONObject();
    		String orgName = GroovyUsersSession.getValue('${org}.name');
    //String userName = GroovyUsersSession.getValue('${user}.name');
    		orgName = orgName.replaceAll("'","");
    //userName  = userName .replaceAll("'","");
    		responseJson.put("url","jdbc:mysql://192.168.2.94:3306/"+orgName);
    		//responseJson.put("url","jdbc:mysql://192.168.2.94:3306/"+userName );
    	          return responseJson;
    	      }
    	    ]]>
    </Condition>
    </Connection>
    </DataSources>
    </EFWD>
    
  3. In this above code, you have to pass your database connection details. Here if you want database switching based on logged in user then you can comment all the lines related to orgName and uncomment all the lines with userName.
  4. Now go to the following location and open JS file of the database you are using.
  5. Location:: \hi\hi-repository\System\Admin\SqlFunctions

    Here I have used MySQL so I will open mysql.js. Replace the following code with previous code (The Highlighted portion is the changes that have been done):

    function setQueryOffsetLimit(query, offset, limit,context) {
    
    	var obj = JSON.parse(context);
    	var orgName = obj.orgName;
    	var userName = obj.userName;
    	query = query.split("#org#").join(orgName);
    //query = query.split("#user#").join(userName );
        if (limit == 0) {
            return query;
        }
    
        if (offset == 0) {
            return query + " \nlimit " + limit;
        }
    
        return query + " \nlimit " + limit + " offset " + offset;
    }
    
  6. Create organizations and users in Helical Insight. Note that here the organization name must be similar to the database which is created.
  7. Now open Helical Insight application. Click on data source then click on Advance. You will see the various types of connections that can be established. If you are using Managed Groovy JDBC Connection, click on Managed Groovy JDBC Datasource and provide the details.
  8. If you are using Groovy Plain JDBC connection, click on Groovy Plain JDBC Connection option and provide the details.

    Now test connection for the created data source. We can see the connection id here which is provided in the EFWD file, also the name of the folder in which you have saved your EFWD file is visible in DIR.

  9. Now create metadata by clicking on the “metadata icon”. (rightmost icon in Actions_ from the above Groovy source.) By default in current database field the database name is visible we have to remove that current database name and then save the metadata.
  10. Share the metadata with organization/users etc who will be viewing the reports and dashboards.
  11. Now create the report. When you log in as other organization/user you will see the metadata dynamically switching to other data sources.
  12. Open report you will be able to see data from that particular database. The same can also be verified by clicking on SQLViewer and verifying the SQLQuery.

Helical Insight’s self-service capabilities is one to reckon with. It allows you to simply drag and drop columns, add filters, apply aggregate functions if required, and create reports and dashboards on the fly. For advanced users, the self-service component has ability to add javascript, HTML, HTML5, CSS, CSS3 and AJAX. These customizations allow you to create dynamic reports and dashboards. You can also add new charts inside the self-service component, add new kind of aggregate functions and customize it using our APIs.
Helical Insight’s self-service capabilities is one to reckon with. It allows you to simply drag and drop columns, add filters, apply aggregate functions if required, and create reports and dashboards on the fly. For advanced users, the self-service component has ability to add javascript, HTML, HTML5, CSS, CSS3 and AJAX. These customizations allow you to create dynamic reports and dashboards. You can also add new charts inside the self-service component, add new kind of aggregate functions and customize it using our APIs.
Helical Insight, via simple browser based interface of Canned Reporting module, also allows to create pixel perfect printer friendly document kind of reports also like Invoice, P&L Statement, Balance sheet etc.
Helical Insight, via simple browser based interface of Canned Reporting module, also allows to create pixel perfect printer friendly document kind of reports also like Invoice, P&L Statement, Balance sheet etc.
If you have a product, built on any platform like Dot Net or Java or PHP or Ruby, you can easily embed Helical Insight within it using iFrames or webservices, for quick value add through instant visualization of data.
If you have a product, built on any platform like Dot Net or Java or PHP or Ruby, you can easily embed Helical Insight within it using iFrames or webservices, for quick value add through instant visualization of data.
Being a 100% browser-based BI tool, you can connect with your database and analyse across any location and device. There is no need to download or install heavy memory-consuming developer tools – All you need is a Browser application! We are battle-tested on most of the commonly used browsers.
Being a 100% browser-based BI tool, you can connect with your database and analyse across any location and device. There is no need to download or install heavy memory-consuming developer tools – All you need is a Browser application! We are battle-tested on most of the commonly used browsers.
We have organization level security where the Superadmin can create, delete and modify roles. Dashboards and reports can be added to that organization. This ensures multitenancy.
We have organization level security where the Superadmin can create, delete and modify roles. Dashboards and reports can be added to that organization. This ensures multitenancy.
We have organization level security where the Superadmin can create, delete and modify roles. Dashboards and reports can be added to that organization. This ensures multitenancy.
We have organization level security where the Superadmin can create, delete and modify roles. Dashboards and reports can be added to that organization. This ensures multitenancy.
A first-of-its-kind Open-Source BI framework, Helical Insight is completely API-driven. This allows you to add functionalities, including but not limited to adding a new exporting type, new datasource type, core functionality expansion, new charting in adhoc etc., at any place whenever you wish, using your own in-house developers.
A first-of-its-kind Open-Source BI framework, Helical Insight is completely API-driven. This allows you to add functionalities, including but not limited to adding a new exporting type, new datasource type, core functionality expansion, new charting in adhoc etc., at any place whenever you wish, using your own in-house developers.
It handles huge volumes of data effectively. Caching, Pagination, Load-Balancing and In-Memory not only provides you with amazing experience, but also and does not burden the database server more than required. Further effective use of computing power gives best performance and complex calculations even on the big data even with smaller machines for your personal use. Filtering, Sorting, Cube Analysis, Inter Panel Communication on the dashboards all at lightning speed. Thereby, making best open-source Business Intelligence solution in the market.
It handles huge volumes of data effectively. Caching, Pagination, Load-Balancing and In-Memory not only provides you with amazing experience, but also and does not burden the database server more than required. Further effective use of computing power gives best performance and complex calculations even on the big data even with smaller machines for your personal use. Filtering, Sorting, Cube Analysis, Inter Panel Communication on the dashboards all at lightning speed. Thereby, making best open-source Business Intelligence solution in the market.
With advance NLP algorithm, business users simply ask questions like, “show me sales of last quarter”, “average monthly sales of my products”. Let the application give the power to users without knowledge of query language or underlying data architecture
With advance NLP algorithm, business users simply ask questions like, “show me sales of last quarter”, “average monthly sales of my products”. Let the application give the power to users without knowledge of query language or underlying data architecture
Our application is compatible with almost all databases, be it RDBMS, or columnar database, or even flat files like spreadsheets or csv files. You can even connect to your own custom database via JDBC connection. Further, our database connection can be switched dynamically based on logged in users or its organization or other parameters. So, all your clients can use the same reports and dashboards without worrying about any data security breech.
Our application is compatible with almost all databases, be it RDBMS, or columnar database, or even flat files like spreadsheets or csv files. You can even connect to your own custom database via JDBC connection. Further, our database connection can be switched dynamically based on logged in users or its organization or other parameters. So, all your clients can use the same reports and dashboards without worrying about any data security breech.
Our application can be installed on an in-house server where you have full control of your data and its security. Or on cloud where it is accessible to larger audience without overheads and maintenance of the servers. One solution that works for all.
Our application can be installed on an in-house server where you have full control of your data and its security. Or on cloud where it is accessible to larger audience without overheads and maintenance of the servers. One solution that works for all.
Different companies have different business processes that the existing BI tools do not encompass. Helical Insight permits you to design your own workflows and specify what functional module of BI gets triggered
Different companies have different business processes that the existing BI tools do not encompass. Helical Insight permits you to design your own workflows and specify what functional module of BI gets triggered