Now that we have learnt how to create a simple report using Helical Insight Community Edition (CE), next step is to add input parameters ,filters to the dashboard and a button on whose click the chart will trigger.

select box and button
 

    Before going in detail on what changes/addition is to be made to the files. Let’s look at the overall flow.

  • We will define two parameters (start_date, end_date) in the ‘datasource.efwd’ file inside <parameter> tag.
  • We will define two dashboard variables (s_date, e_date) in the ‘Template.html’ file.
  • We will also create input boxes using the ‘Template.html’ file.
  • These select boxes will assign(set) the dashboard variable with some values on selection.
  • These variables defined in the ‘Template.html’ file are then passed to the parameters defined in ‘datasource.efwd’ file.

Template and DataSource

1. Changed needed in datasource.efwd

Open the “datasource.efwd” file using any text editor. In this file we will define the two parameters inside the parameter tag in the <DataMap>.
These parameters can be given a default value.

Parameters created in ‘.EFWD’ file will hold the value of dashboard variables.Value to dashboard variable will be assigned through the select box.

These parameter’s value can be used in the query inside ‘where’ condition by giving the parameter name in a proper syntax. Syntax to be used :- ${parameter_name}
For eg:- In our case ${start_date} .
Now on execution, the query fetches the data corresponding to the value being held in the parameter.

 

<DataMap id="1" connection="1" type="sql" >
           <Name>Pie Chart</Name>
            <Query>
                <![CDATA[
                        select SampleTravelData.meeting_details.client_name as client,
		        sum(SampleTravelData.TravelDetails.travel_cost) as cost 
  From SampleTravelData.TravelDetails 
   inner join SampleTravelData.employee_details on (SampleTravelData.employee_details.employee_id = SampleTravelData.TravelDetails.travelled_by)      inner join SampleTravelData.meeting_details
 on (SampleTravelData.employee_details.employee_id=SampleTravelData.meeting_details.meeting_by) 
		
where
(SampleTravelData.meeting_details.meeting_date > ${start_date} AND SampleTravelData.meeting_details.meeting_date < ${end_date}) 
group by client order by cost desc limit 10
                ]]>
            </Query>

             <Parameters>
<Parameter name="start_date" type="String" default="’2015-01-01 12:00:00’"/>
<Parameter name="end_date" type="String" default="’2016-01-01 12:00:00’"/>
	</Parameters>

        </DataMap>

 

  • <Parameter> :- Add this tag to the <DataMap> tag.Inside parameter tag define the name, type and the default value which is to be given to the parameter.
  • Parameter Name :- It can be any name of user’s choice which will be used in the ‘Template.html’ file to pass the dashboard variable to it.
  • Parameter Type :- It can be of type ‘String’ or ‘Collection’ in case of an array.
  • Parameter Default :- Inside default attribute, one can give a value to be used as default while executing the query. This default value will be assigned to the parameter and the query on execution will fetch data corresponding to the default value assigned to the parameter.
  • Parameters can be used inside the query in a specific format as shown above ${start_date}
    And its value can be used.
  • By default any value can be given to the parameter.

 

2. Changes needed in Template.Html

Open the “Template.html” file using any text editor. We will create two input boxes (select without search), dashboard variables (s_date, e_date).
The select boxes on selection of any option will set the dashboard variables (s_date, e_date).
Dashboard variables will be assigned to the two parameters (start_date, end_date) We will also add a button (SUBMIT) which will trigger the chart and the chart will show data for the selected values.

 

First we will define the HTML ids where the chart, select box and the ‘runButton’ will be displayed.
<div class="row" style="margin-top: 25px;">
			<div class="col-sm-2" id="paramLabel">Select Month:</div>
			<div class="col-sm-4" id="startDate"></div>
			<div class="col-sm-4" id="endDate"></div>
			<div class="col-sm-1" id="runButton"></div>
</div>
<div class="row pie">
			<div class="col-sm-12" id="sampleChart"></div>
</div>

 

Now, define variables on the dashboard (report) to be set by the select boxes. These values will be passed to the two parameters.
var dashboard = Dashboard;

dashboard.resetAll();
dashboard.setVariable('s_date', '2015-01-01 12:00:00');
dashboard.setVariable('e_date', '2015-02-01 12:00:00');

 

Now, to add select components, we will define it inside the script in the same manner as we have defined the chart and will add it to the dashboard components.
var start_date = {                                   // Define an  object.
    name: "start_date",
    type:  "select",
	parameters :["s_date"],   // The dashboard variable name that it will be using to set value
	options:{
        multiple:false,                              // Multiple select is false.
        value : 'value',                             // Value to be assigned to the parameter.
        display : 'display'                       // Value to be displayed for the user to see.
    },
    htmlElementId : "#startDate",    //The html id where the component will be displayed.
    executeAtStart: true,                   // If true , component will be rendered at the load of page.
	map:2                                   // The <DataMap> id to be used to fetch the data.
};

 

  • Name :- Can be any name of user’s choice.
  • Type :- Specify the type of input.
  • Parameters :- Specify one of the dashboard variable name ,defined above, to be used for setting the value
  • Options(Value) :- Define the column from the query whose value will be assigned to the parameter specified in the parameters.
  • Options(display) :- Define the column from the query whose value will be displayed on the select box.
  • Options(multiple) :- Set to true when multiple values can be selected at once.
  • htmlElementId :- The html id where the component will be displayed on the page.
  • ‘Map:2’ :- The data will be fetched from the having Id equals to 2 in the ‘datasource.efwd’ file.

 

In the same manner make another select component which will have ‘e _date’ in the parameter.

 

var end_date = {
    name: "end_date",
    type:  "select",
	parameters :["e_date"],
	options:{
        multiple:false,
        value : 'value',
        display : 'display',
    },
    htmlElementId : "#endDate",
    executeAtStart: true,
	map:2
};

 

Note :-Now, since we have defined the ‘map:2’ we will define a <DataMap> inside the <DataMaps> with id 2 in ‘datasource.efwd’. The data will be fetched from the <DataMap> having Id=2.

 

Till now, we have created the select boxes and used its selection as value to assigned to the dashboard variables.

 

We need to add ‘requestParameters’ key in the ‘chart’ object to pass the value of dashboard Variables to the parameters (start_date, end_date).

var chart = {
    name: "chart",
	type:  "chart",
	vf : {
		id : 1,
		file : "Table.efwvf"
	},
	requestParameters : {
		start_date: "s_date",
		end_date: "e_date"
	},
    htmlElementId : "#sampleChart",
    executeAtStart: true
};
  • start_date :- The parameter ‘start_date’ which we have defined in ‘datasource.efwd’ file will take the value dashboard variable ‘s_date’ defined in the ‘template.html’ file
  • end_date :- The parameter ‘end_date’ which we have defined in ‘datasource.efwd’ file will take the value of dashboard variable ‘e_date’.

 

Now on click of ‘runButton’ the chart must render/trigger.
Hence add component ‘run_button’ to it as follows.
var runButton = {
    name: "runButton",
	triggers:["chart"],
    type:  "button",
	options:{
			display: "Generate Chart"
		},
    htmlElementId : "#runButton",
    executeAtStart: false    
};

 

  • Name :- Can add any name of user’s choice.
  • Triggers :- The component which will be triggered on click of the button.
  • Type :- Specify the type which is button.
  • Options(display) :- Give the value of user’s choice which will be displayed on the button.
  • htmlElementId :- The html element id where the button will be displayed.

 

Now define a variable ‘components’ which will have all the components to be shown on the dashboard.
Initialize the dashboard with all the components.
var components = [runButton, start_date, end_date, chart];
dashboard.init(components);

 

Save all the edited files and go in the HI application to run the report.

Final Report

Leave a Reply

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