Hi,
I have parent & child repeat. Parent-Repeat are Storages and Child-Repeat are Books.
I am using sum(${}) and coalesce(${},0) to count all books, but when I add new Storage ID, the Total Number of Book reset and started to zero.
Is there a way how to count all books? or how many book already counted?
From the picture below, the Total Numbers of Books should be 3 books.
Thanks.
Solved! Go to Solution.
Hi @bhariadi
Thanks for providing your XLSForm.
Please see attached a simplified XLSForm that attempts to solve your problem using the count() function, and also by rearranging the questions slightly.
One thing to note here is that I've avoided using aggregate functions (sum, count, etc.) inside the repeat that the function is aggregating. Please see the Survey123 Tricks of the Trade: Repeats blog post for some great info, as well as the documentation on repeats.
Hope this useful, please let me know if this works for you.
Best, Jim
Hi @bhariadi
Thanks for providing your XLSForm.
Please see attached a simplified XLSForm that attempts to solve your problem using the count() function, and also by rearranging the questions slightly.
One thing to note here is that I've avoided using aggregate functions (sum, count, etc.) inside the repeat that the function is aggregating. Please see the Survey123 Tricks of the Trade: Repeats blog post for some great info, as well as the documentation on repeats.
Hope this useful, please let me know if this works for you.
Best, Jim
Hi Jim,
That's great! Thank you for your help. Your solution is work. I will try to implement this concept for My real project.
Will update the result as soon as possible.