Select to view content in your preferred language

Adding additional values to a Sum Statistic in Reports

225
0
11-03-2023 03:06 PM
AbigailEbelherr
New Contributor III

In my survey, I have multiple decimal fields.   Some questions are conditional, such as funding_source, so they are left with null values when not answered. Other questions are calculated, such as total_funds, so they are left with 0 if nothing is entered.

In my summary report, I have been using the sum statistic for my entries and formatting them so I can have trailing zeroes as these are dollars:

${survey | stats: "sum,funding_source"| format:”#,##0.00”}

${survey | stats: "sum,total_funds"| format:”#,##0.00”}

The problem is that funding_source comes out as blank at the end of my tables if there are no entries, but total_funds come out 0.00 if there are no entries.  I would like it to be consistent.  I thought I could fudge it by adding 0 to the funding_source such as:

${survey | stats: "sum,funding_source"+0| format:”#,##0.00”}

but that always gives me an error.  I've also tried putting parentheses around "sum,funding_source" but that doesn't work, either.  Can you not add additional numbers to sum functions?  If not, how should I have the funding_source sum display as 0.00 instead of a blank?  Making the default 0 in Survey123 Connect doesn't work because it doesn't fill unless the question is answered.

Thank you for your help.

0 Kudos
0 Replies