Use case
Return the sum the values of a specific field from the issues returned by a JQL query.
Expression
Create and configure a Smart field using this expression in General parsing mode:
%{ sum(fieldValue({issue.cfnnnnn},issuesFromJQL("project = DEMO and fieldName is not empty"))) }
Please, replace nnnnn in the above expression with the ID of the Number custom field.