Select to view content in your preferred language

running totals over time

920
2
11-11-2017 08:40 AM
AaronPeyrouse
New Contributor

New to survey 123, I have created a survey that collects weather data. I would like it to keep a running total of snowfall for the season based 24 hour snowfall. Is it possible to perform a calculation based on the previous days answer?

0 Kudos
2 Replies
IsmaelChivite
Esri Notable Contributor

Hi. It depends on how you configure the survey:

  • If your survey is designed to report weather data for one day at a time, then you can only aggregate the data in the back-office accessing all records in your feature layer.
  • If your survey is configured with a repeat block allowing capture of weather data for multiple days of a month within a single form, then you can do client-side aggregation and averaging using the sum and count functions against records in your repeat.

From a practical perspective, you may want to keep your survey simple and go with an option where  weather data  is reported one day at a time (without a repeat).  Using HTML formatting in the label of a note question, or in the description of the survey, you could link into an external web application where the user could look at the aggregated data.  You could for example use Web AppBuilder to filter by station/month, aggregate the weather data and then simply link to your web app from the survey.

LucianoCampagnolo1
Occasional Contributor

Hi Ismael!‌,

Suppose that you go for the option with the repeat block, then you need to use sum() and count() functions to aggregate values for some fields from all responses. BUT, what if you need to access all the responses from these fields?

I've a similar case where I need to display all the responses to some fields in the repeat group, going through the documentation for XLSForm I discovered that there is also a join() and a indexed-repeat() functions to access data inside the repeat group.... It seems that these functions are not yet supported in Survey123 or, at least, I can't make them work... 

Do you have any insights on this?

Thanks in advance,

Luciano

0 Kudos