calculate total data on spending details