Row Total as 1st Record

Hi,

I am creating tabular report in 4.1 GA Helical Insight enterprise edition application and I want to add row total. I have followed this URL : Add Total Row for Tabular Report

But this adds row at very bottom. But I want to apply it at top (as 1st record). How to do this?

The reason I want to do this at the top so that people don’t have to scroll so much till end to see the value.

Thanks,
Netta.

Hi,
This below answer is only applicable to below version 5.0 of EE of Helical Insight.
In order to add ROW total as very first record (top of all rows), you have to made some changes in script which you were following. Below I am providing updated scripts (2 scripts), apply both scripts one after other in JS editor of your adhoc report.

This will disable pagination and shows all records on single page and at top it will show TOTAL :

  1. Create any tabular report.
  2. Inject this script in JS Editor to remove pagination. This step we are following because we want total of every row and not for just that page. Removing pagination will show all data at once on a single page:
hi_container.set("preExecution",function(c){
var viz_Options = c.get("viz_Options");
viz_Options["rowCount"] = [-1];
c.set("viz_Options",viz_Options);
});

Inject another script mentioned below to show TOTAL value as ROW at very top.

hi_container.set("postFetch",function(c){  
var responseData = c.get("responseData");  
var measure1 = 0;  
for(var i=0;i<responseData.data.length;i++){
measure1 += responseData.data[i].sum_travel_cost;
var fullSumMeasure1 = measure1; 
}  
responseData.data.unshift({employee_name: "<b>TOTAL</b>", sum_travel_cost: fullSumMeasure1});   c.set("responseData",responseData);
});

NOTE : Modify above script mentioned in STEP 3 as per your data and requirement. In our case the report data is with column as “sum_travel_cost”. Also make sure you inject both of the above script separately and not at a time.

Thank You,
Helical Insight.