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 datasources based on certain condition.
For example : In healthcare industry the data of the hospital can not go outside the hospital premises. In that case, based on which hospital user has logged in, the metadata should connect to a different physical database.

Note: This solution will work if the DBName, table name, column name and schema is same,even though the physical server, DB credentials etc could be different.

NOTE: This solution will only work with Helical Insight Enterprise Edition.

Below is the flow diagram which explains the overall flow of Dynamic Database Switching.

Flow Diagram

Steps to be followed to connect with different datasources.

Step 1:Using any editor like notepad++ create a file with an extension .efwd containing datasource connection details and conditions for checking which organization/user/role is logged in and accordingly connecting to a different database. Now create folder in the Helical Insight repository with any name and Save this .efwd file in the created folder.

Location for Helical Insight repository is: ..\Helical Insight\hi\hi-repository

Note: In your case location can be different based on the Helical Insight installation directory.

Sample code for EFWD DataSource is shown below:

<EFWD>
   <DataSources>
      <Connection id="12" type="sql.jdbc.groovy">
         <Driver>com.mysql.jdbc.Driver</Driver>
            <Url>jdbc:mysql://localhost:3306/SampleTravelData</Url>
            <User>root</User>
            <Pass>root</Pass>
	 <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');
		orgName = orgName.replaceAll("'","");
	          sql=Sql.newInstance('jdbc:mysql://localhost:3306/details', 'hiuser', 'hiuser', 'com.mysql.jdbc.Driver');
		sql.eachRow( 'select * from details' ) {
		
		   if(orgName.equalsIgnoreCase(it.organization)){
		     responseJson.put("driver",it.driver);
		     responseJson.put("url",it.url);
		     responseJson.put("user",it.user);
		     responseJson.put("password",it.password);
		   }
	          }
	          return responseJson;
	      }
	    ]]>
           </Condition>
        </Connection>
    </DataSources>
</EFWD>

Where:

DataSources

It is a collection of connection(s) that are to be used by the adhoc module.

Connections

It defines a connection, and the parameters of the connection that are provided via its child-nodes. It must also have an unique id attribute (used for its identification) and a type attribute (depends on settings). Here type must be sql.jdbc.groovy.

Driver

Driver details of the Database you want to connect. Here we are connectiong the MySql database so Driver is provided as com.mysql.jdbc.Driver

URL

Url of the database you want to connect. It contains the host address with database name.

Example:jdbc:mysql://localhost:3307/SampleTravelData

Username:Username of the database.

Password:Password of the database.

Condition:Here we define the condition for checking which organization/user is logged in and based on the condition we will pass the Driver details, Url, Username, Password. The code which is written in the Condition Tag is in the Groovy language.

In sql we write the sql query to fetch the data from database where datasource details are defined. From there we will retrieve the datasource details which can be used for maintain the datasource connection depending on the organization. Using sql.eachRow we loop over rows fetched from the database.

Note:Organization Name in the database and organization created with Helical Insight application must be same.

Sample Database is like below:

Database

Example:

<![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');
	    orgName = orgName.replaceAll("'","");
	    sql=Sql.newInstance('jdbc:mysql://localhost:3306/details', 'hiuser', 'hiuser', 'com.mysql.jdbc.Driver');
	    sql.eachRow( 'select * from details' ) {
		if(orgName.equalsIgnoreCase(it.organization)){
		     responseJson.put("driver",it.driver);
		     responseJson.put("url",it.url);
		     responseJson.put("user",it.user);
		     responseJson.put("password",it.password);
		   }
	          }
	          return responseJson;
	      }
	]]>

In this case we are checking which organization is logged in and depending on the organization we are changing the datasource details. Similarly it can be used to check for role or user by using ${role}.name and ${user}.name respectively. Database column details can be fetch by ‘$it.column_name’

Step 2:Go datasources tab.

Step 3:Click on Advanced

Step 4:Select the Datasource type as the Groovy Plain Jdbc DataSource.

Step 5:Select created groovydatasource in the View tab. Also Test the connection. Click on “Create Metadata”.

Step 6:You will be navigated to metadata page. You can hover over the Info icon and can see the kind of datasource type (groovy in our case).

Step 7:Create metadata from this connection. By default in current database field the database name is visible we have to remove that current database name and then save the metadata. Then that metadata can be used for reports and dashboards creation.

Step 8:Disable the cache in Helical Insight

1). To disable the cache go the Helical Insight Admin folder and open the cache.xml file for editing it and set <enableCache> to false.

Location: ..hi\hi-repository\System\Admin\cache.xml

Note:In your case location can be different based on the Helical Insight installation directory.

Disable_Cache

2). Login to Helical Insight Application using the super admin credentials and click on the cache button of Reload Setting. This will reload the cache setting of Helical Insight.

Reload_Settings

Now login to the different organization to access the report to see the data associated with that organization.

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