Select a group of items in a subform and sum the value of a field of these group of items.

Select a group of items in a subform and sum the value of a field of these group of items.

Hi, I am very new to these deluge scripts, I am creating a system here in Zoho Creator.

I have a group of items in a subform, In here I have a field called "Bill N°", that has the choices "1", "2", "3", "4".
also there is a "Price" field for each item.

What I want to do its take all the items in this subform that are in the "Bill N°" choice "1", and take all the prices in these group of items and then sum them all to get a total in another field outside the subform.

I was following this guide: https://www.zoho.com/creator/help/tutorials/advanced-app-building.html#Subform-Actions.

I see that they are trying to do a similar process but I can't get it to work, I also don't really understand how is the syntax in deluge to select a group of items.

Can anyone with some experience in Deluge give me an idea on what I need to do in order to make this?.

Thank you all.