2

I have a category group named country. Each entry in posts is assigned to a country and a dollar value. dollar value is a field, NOT a table cell.

On a country's given page (i.e., a category page), I want to sum the total value across all entries assigned to a given country by year (date posted) across all years for which there are entries.

Help...

1 Answer 1

1
{% amount = craft.entries
   .postDate(['and', '>=' someDate, '<=' ~ someOtherTime])
   .select('dollar')
   .relatedTo(category)
   .sum()
%}

Loop through all years and sum the value

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.