Post

1 follower Follow
0
Avatar

Struggling to get a table set up

Hi everyone,

I'm trying to set up a table inside of a calculation field.

The table needs to amalgamate the information from a series of daily timesheet records against different codes based on the placement within a form. Example below:

 

Date    Code   Total Code 1  Total Code 2    Total Code 3    Total Code 4 etc

 

 

The app I have createed is linked to the allocation of time (so as to draw on the code) and linked to the timesheet (to draw the daily totals).

 

Below is what I have got so far but, at this point, it is returning nothing. Any help would be greatly appreciated.

 

var Date= @All of Date;
var FunderCode= @All of Funder string
var Funder1Hours= @Sum of Hours Worked - Funder 1;
var Funder2Hours= @Sum of Hours Worked - Funder 2;
var Funder3Hours= @Sum of Hours Worked - Funder 3;
var Funder4Hours= @Sum of Hours Worked - Funder 4;
var Funder5Hours= @Sum of Hours Worked - Funder 5;
var Funder6Hours= @Sum of Hours Worked - Funder 6;
var Funder7Hours= @Sum of Hours Worked - Funder 7;
var Funder8Hours= @Sum of Hours Worked - Funder 8;
var lines = [];
for (var i =0; i< Date.length;i++){
lines.push(Date[i] = " | " + FunderCode[i] + " | " + Funder1Hours[i] + " | " + Funder2Hours[i] + " | " + Funder3Hours[i] + " | " + Funder4Hours[i] + " | " + Funder5Hours[i] + " | " + Funder6Hours[i] + " | " + Funder7Hours[i] + " | " + Funder8Hours[i]);
};
"Date | Funder Code | Funder 1 Hours | Funder 2 Hours | Funder 3 Hours | Funder 4 Hours | Funder 5 Hours | Funder 6 Hours | Funer 7 Hours | Funder 8 Hours \n"+
"--- | --- | --- | --- | --- | --- | --- | --- | --- | --- \n" +
lines.sort(Date).join("\n")

 

Thanks! - Bill

 

William Brotherton

Please sign in to leave a comment.