How to add values of an integer field for multiple entries in a collection? #9205
Unanswered
tenmillionteeth
asked this question in
Q&A
Replies: 1 comment
-
I would make a custom tag for it, then use the Entry facade to do the query and use ->sum() or ->avg() on the resulting collection. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have a client with a collection of entries that include an integer field. They would like to add up the values from that integer field for all entries in the collection that meet filtered criteria, and then display an averaged value. Simple enough, but I'm not sure how to approach it in an Antlers context.
How would I sum the values from all of the entries?
Beta Was this translation helpful? Give feedback.
All reactions