Calculate the sum of a metadata

Elgg 2.3.14

Is there a way to calculate the sum of a numeric metadata of entities directly on the database?

Thank you