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
{% amount = craft.entries
   .postDate(['and', '>=' someDate, '<=' ~ someOtherTime])
   .select('dollar')
   .relatedTo(category)
   .sum()
%}

Loop through all years and sum the value

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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