tots.per.location function

function to compute totals per location