Hi - I am wondering if anyone would be able to help me with this script. I am new to Javascript and can’t get this to work. What I am trying to do is return the pptCount except for ‘All’ ( the first 5 counts only).
results.each(function(index) {
var ageCnt = record.tables["BalByAge"][index].fields["pls_ageCnt"];
var field, result = "";
for (var i = 0; i < results.length -1; i++)
field = ageCnt;
if (field != "") result += field;
this.html(result);
});
Remove the last element of the array and iterate like you’re doing.
You can remove without modifying the original array with slice(-1, 1), you can modify the original array by using splice(-1, 1), or you modify the original array and return the removed item with pop().