At times it becomes necessary to add up the data with in a column. Here is a nice little snippet that can do just that.
Change DATATABLE with the name of the data table you need to read.
Change COLUMNNAME with the column key in the table you need to read.
// First get the record set from the datatable.
var records = DATATABLE.getRecordSet();
// Let's count how many records we found
var len = records._records.length-1;
var total = 0;
// Loop through the record set getting the data from the coulumn and setting its value to "value"
for(i=0;i<=len;i++){
//create the value you need so you can handle the data
var value = records._records[i]._oData.COLUMNNAME;
// now all you need to do is add up your values
total+=value;
}
//log it to the FireBug console
console.log(total);
Once you have found the value for the column from that point you can manipulate the data to your will.