Hi, did you try using the Calculation Field? Alternatively, you could use custom JavaScript to perform the calculation after retrieving the field values using Javascript API#getValues(fieldId).
You can add Custom Html to your form and write Js to calculate.
How to show the sum of total quantity based on IDValues in text field read-only like
ID=123
value=10
ID=123
Value=12
Total Values=10+12 (ID unique value=123)