Calculating sum of repeat outside repeat group

Hello Everyone,

I am collecting the cost of selling items in total price, my issue is I can not seem to get odk to calculate the sum of total sales:

An example:

How many items did you sell?
3
Begin Repeat
1- Name of product
2- What are the total sales ?
Etc...
End Repeat

Calculate sum of all sales from 3 repeats seems to be difficult. I tried the indexed-repeat but it must be more than one field in order to calculate it. I am coding on xls, any help or suggestions would be highly appreciated.

Thank you !

Hi @Maya

try sum function.
You can find a sample form there as well just click show details.

Thank you @Grzesiek2010 !! that seems to do the trick