It is very typical to render a list of items and display a total row at the bottom of the table. An example in the UI Gallery called 'Table with total rows' demonstrates how to implement such UI using the optimized and legacy tables as well as using a repeating dynamic layout.
The example showcases how to edit the data using a legacy table but does not provide any example of how to achieve a similar functionality using an RDL
The attached RAP replace the RDL example and makes the RDL editable - It also showcased how the group can be expand / collapse and how to implement group level action like 'clear quantity'
to use this example, import the attached RAP, add the ruleset RDLTotal:01-01 to your app and reopen the UI Gallery and navigate to the Table with total row example