Forum Discussion
IvanWeiss
3 years agoQrew Captain
I actually solved my own problem so figured I would post the results. I dont know why but I find formula queries so intimidating. But once I wrote out what I was trying to do in English here it got a lot more clear for my query so I was able to do it:
//Get all of the Team Member Records in which the title is the same
//Summarize all of the Current Salaries for these records
//Divide the sum of salaries by the number of records
//Return the Average Team Salary
//Field ID's
//[Title] = 28
//[Current Salary] = 33
//QUERY = Give me the Team Member Records in which the title is the same
//QUERY Exclude any records where the salary is 0
var text QUERYONE = "{28.EX.'" & [Title] & "'} AND {33.GT.0}";
//Determine the number of records in the above query
var number NumberTeamMembers = Size(GetRecords($QUERYONE));
//Determine the total salary of employees in the above query
var number TotalSalary = SumValues(GetRecords($QUERYONE),33);
//Return the Total Salary / Number of Team Members with the same title
$TotalSalary / $NumberTeamMembers
------------------------------
Ivan Weiss
------------------------------
//Get all of the Team Member Records in which the title is the same
//Summarize all of the Current Salaries for these records
//Divide the sum of salaries by the number of records
//Return the Average Team Salary
//Field ID's
//[Title] = 28
//[Current Salary] = 33
//QUERY = Give me the Team Member Records in which the title is the same
//QUERY Exclude any records where the salary is 0
var text QUERYONE = "{28.EX.'" & [Title] & "'} AND {33.GT.0}";
//Determine the number of records in the above query
var number NumberTeamMembers = Size(GetRecords($QUERYONE));
//Determine the total salary of employees in the above query
var number TotalSalary = SumValues(GetRecords($QUERYONE),33);
//Return the Total Salary / Number of Team Members with the same title
$TotalSalary / $NumberTeamMembers
------------------------------
Ivan Weiss
------------------------------