It would help if you added more details to your question so there is more context around what you have, and what exactly you're trying to accomplish. I highly recommend quality time with the Search Reference Manual as there are tons of things that could apply.
For example you may be looking for stats, eventstats, or streamstats. These commands and a few others are able to calculate statistical functions. If you're wanting to add these statistics as new records combining with appendpipe is very powerful. If you're looking for strictly sums of rows or columns, addtotals and addcoltotals may be what you're looking for instead. As you can see, there's lots of ways to accomplish similar tasks depending on your goals 🙂