Xpath Queries to calculate sum of subject

Hi Everyone, i want to write xpath to calculate sum of 5 subjects and store it in column total marks. for example: So i want to calculate sum of each subject and store it in total ? How can i achieve this?   Thanks
1 answers

Assuming that each row is an object in your database I would simply either add an entity total and let it calculate it in an after commit flow or use a calculated field for it. That last one has some performance drawbacks but depending on how much data you have I would not worry about it much.

This way you do not have to use Xpath at all.