Hi I have a Survey with a repeat table. The repeat imports records, and prepopulates fields from a CSV. The repeat won't have new records added in by the field workers. The workers will just update some fields from the already prepopulated (by the CSV) ones, in all the repeat's records.
I want the field workers to have in the form, a repeat title stating the current record against the total records; i.e 5/55. So they will know how many records they have to complete in total for that survey point.
Can I create a hidden question with a calculation that will bring me the sum of all the CSV's entries (Sum of all the rows)?
Thanks.
Solved! Go to Solution.
So, I finally found a correct way to address the requirement. I created another csv file derived from a frequency table that contained the sum of the values that I needed. That was used with a pull data to prepopulate the question ${calculation_of_CSV_entries}.
Hello @Cyprus_Forest_Department,
With 3.12 we are introducing support for indexed repeats. Please check out this EAC documentation for more information on the updates. Specifically I think the `position(..)` function may help with calculating the repeat title.
Another option that currently works in 3.11 is to add a hidden question in the survey with the default value of 1, then add a calculate question that uses once(count(${default1Question})) and that will return the current repeat instance.
Thank you,
Zach
Hi Zach. I read your comment and the EAC documentation "Query values from questions inside indexed repeats" section. However my situation is somewhat different. I have already set a "counter" for the user.
My problem is that I use pull data from a CSV to prepopulate the answers, and the user will only update the values of the questions where changes occured.
So as an example of what I need, if the CSV has 20 entries, can I have this value calculated in my survey? A question that will bring me the total number of entries of the CSV.
This value will be used in the form as a progress indicator along with my counter; i.e 1/20 (1 out of 20) in a text label like ${counter}/${calculation_of_CSV_entries}
So, I finally found a correct way to address the requirement. I created another csv file derived from a frequency table that contained the sum of the values that I needed. That was used with a pull data to prepopulate the question ${calculation_of_CSV_entries}.