Select to view content in your preferred language

How to use Survey123 Summary Reports for Monthly Inspection Report

2887
2
Jump to solution
01-06-2021 07:04 AM
Labels (1)
by Anonymous User
Not applicable

Short Question: How do I get a sum of values for a question for each uniquely named pump station in a summary report? (see further explanation below)

I've developed a workflow for my client to do Pump Station inspections using Survey123.  They can do as many inspections per pump station as they want in a given month.  Each month they compile the inspection data in a monthly report (See the attachment, "PumpStation-MonthlyReport")  The report compiles the monthly inspection data for each pump station and provides a sum of the values collected for the specified date range (the date range is chosen when running the report in Survey123)

To recreate this report in Survey123 using the Survey123 inspection data, it seems I need to create a summary report. But I'm struggling with the syntax especially when there are multiple inspections for one pump station in a month.  Using online forums etc.  I was able to get the correct syntax to only show the unique pump station names, but I'm unsure what syntax I should be using to say, for example, "sum all the pump 1 run hours for each unique pump station name."

I've attached my working copy for the template.  Once I get the syntax correct, I'll populate the table but until then, I'm working out the syntax below.  Again, I was able to get the Pump Station name to show only the unique names and to not duplicate the names when there are more than one inspections done on a pump station.  But I can't figure out to sum each question for each pump station.

I also attached the Survey123 combination template for reference.

1 Solution

Accepted Solutions
BarbaraWebster1
Esri Regular Contributor

Hi Katie,

If you set up a stats filter with the groupByFieldsForStatistics parameter set to the pump station name, you can also create an outStatisticsFieldName parameter in the outStatistics parameter to hold the sum for each unique pump number. The field name will act as a variable that you can use elsewhere within the summary report.

This is how it would look if you wanted to list the sum for each unique pump number in a table (the outStatisticsFieldName is shown in blue, after the onStatisticsField parameter):

 

Station No.

Pump #1 Total Run Hours

${#PumpStationLogs | stats:"sum, P1_RNHrs, P1_RNHrs_sum":"PSNAME"} ${PSNAME}

${P1_RNHrs_sum}${/}

 

You may have already seen it, but there is additional information on this in the Aggregate Functions section of the Survey123 Report Queries documentation.

-Barbara

View solution in original post

2 Replies
BarbaraWebster1
Esri Regular Contributor

Hi Katie,

If you set up a stats filter with the groupByFieldsForStatistics parameter set to the pump station name, you can also create an outStatisticsFieldName parameter in the outStatistics parameter to hold the sum for each unique pump number. The field name will act as a variable that you can use elsewhere within the summary report.

This is how it would look if you wanted to list the sum for each unique pump number in a table (the outStatisticsFieldName is shown in blue, after the onStatisticsField parameter):

 

Station No.

Pump #1 Total Run Hours

${#PumpStationLogs | stats:"sum, P1_RNHrs, P1_RNHrs_sum":"PSNAME"} ${PSNAME}

${P1_RNHrs_sum}${/}

 

You may have already seen it, but there is additional information on this in the Aggregate Functions section of the Survey123 Report Queries documentation.

-Barbara

by Anonymous User
Not applicable

@BarbaraWebster1 Thanks! I finally figured it out, but I actually posted another questions relating to this, maybe you could help with that one too! Need Help With Survey123 Summary Report Syntax for... - GeoNet, The Esri Community

0 Kudos