Refresh a pourcentage calcul in a repeat function

214
3
Jump to solution
02-08-2023 01:58 PM
daudet84
New Contributor

Hello, 

I am calculating the pourcentage relative of my species in function of their poucentage absolute. To do so, people on the field have to select the species and estimate the absolute pourcentage of each and then the pourcentage relative is calculated. Because i am in a repeat function, they have to go back a refresh everytime a new specie is selected to change the result from the calculation.

How can I code it so they don't have to go back everytime in the repeat to refresh? 

*I tried to get the cacul out of the repeat but as there is a lot of species choices, it is hard to do it.

daudet84_1-1675893416581.png

 

Thank you!

 

 

0 Kudos
1 Solution

Accepted Solutions
BarbaraWebster1
Esri Regular Contributor

@daudet84 I don't believe there is a way to run calculations on a repeat that isn't active. The Aggregate functions section of the documentation mentions this is how calculations in repeats function:

While sum and count values are calculated for each new record added to the repeat, the calculations on previous entries in the repeat are not automatically updated. 

As you mentioned, in order to avoid navigating back through the repeats you would need to do the calculation outside of the repeat. If you are using the data to generate a report, another option might be to generate the value using an expression in the report template instead of calculating the value within the survey form.

View solution in original post

0 Kudos
3 Replies
BarbaraWebster1
Esri Regular Contributor

Hi @daudet84,

If you add calculationMode=always to the bind::esri:parameters column of the questions with the calculations, the value should update without needing to press the refresh button. 

Thanks,
-Barbara

0 Kudos
daudet84
New Contributor

Hi,

Yes now it refreshes automatically but they still have to go back to the first repeat to update everything before sending the results...

Do you think there is a way to modify that as well?

Thank you very much

0 Kudos
BarbaraWebster1
Esri Regular Contributor

@daudet84 I don't believe there is a way to run calculations on a repeat that isn't active. The Aggregate functions section of the documentation mentions this is how calculations in repeats function:

While sum and count values are calculated for each new record added to the repeat, the calculations on previous entries in the repeat are not automatically updated. 

As you mentioned, in order to avoid navigating back through the repeats you would need to do the calculation outside of the repeat. If you are using the data to generate a report, another option might be to generate the value using an expression in the report template instead of calculating the value within the survey form.

0 Kudos