Tell us what you are trying to do?
I have a taxonomy that consists of company > teams > members. I have 4 values set in each custom post for the member that has a numerical value associated with it - those field are: red, blue, yellow, green. I need to add up the totals for red, blue, yellow, and green across all posts that have a specified team ID. So, for example, I have Team Member 1, Team Member 2, and Team Member 3. For each post of [team-member] that has the same team-member-id, I need to add the score for the [red], [yellow], [green], and [blue] fields.
Example:
Team Member 1: Red: 4, Green: 3, Yellow: 2, Blue: 1
Team Member 2: Green: 5, Red: 2, Blue: 2, Yellow: 1
Team Member 3: Blue: 4, Yellow: 3, Green: 2, Red: 1
Knowing this:
I need to know that the total for Green is 10 (the aggregate value for Green for each Team Member)
I need to know that the total for Blue is 7 (the aggregate value for Blue for each Team Member)
I need to know that the total for Yellow is 6 (the aggregate value for Yellow for each Team Member)
I need to know that the total for Red is 7 (the aggregate value for Red for each Team Member)
Once I have this information, I need to then calculate the percentage of each color against the total 'score' for the team, knowing that the total score available is 3 (10 for each team member).
Example:
Green Total: 10, Total Score: 30, Green Percentage: 33.33%
Blue Total: 7, Total Score: 30, Blue Percentage: 23.33%
Yellow Total: 6, Total Score: 30, Yellow Percentage: 20%
Red Total: 7, Total Score: 30, Red Percentage: 23.33%
Is there any documentation that you are following?
Maybe: https://toolset.com/forums/topic/math-calculations-with-custom-fields-of-related-posts-inside-a-view/
Maybe: https://toolset.com/forums/topic/sum-of-fields-in-a-view-2/
Maybe: https://toolset.com/forums/topic/display-sum-of-custom-field/
Is there a similar example that we can see?
What is the link to your site?
hidden link