I need help in summarising two integer fields collected in nested repeats using sum()
I am using ODK collect to gather stock levels across store countrywide. I used two repeats to achieve this:
- The first repeat iterates though commodities
(pre-selected in a select_multiple)
and inside the first repeat, the user mentions which batch numbers were used to receive stocks. - For
each batch
, I askQty received
, andcurrent stock
I now want to summarise the stock levels by aggregating Commodities by their batches (One commodity can be distributed in several batches)
I used the sum()
outside the second repeat(batches)
but inside the commodity repeat
, it however generates errors requiring indexed repeats, and i don't see how to a-chive this since i want to aggregate all batches instances per commodity.
Any help will be highly appreciated