aggregate records of each calendar year

aggregate records of each calendar year

Hello,

could anyone help  me with the script ho to aggregate monthly revenues in a yearly revenue field?
I have three fields
date field
monthly revenue
yearly revenue

I'd like the script to work on user input of monthly revenue field, and want to aggregate the values belong to the same calendar year.

Kind regards
George