Survey 123 Report showing several 0 on calculation

942
5
04-08-2019 02:12 PM
AngeloCapriglione
New Contributor

Hi.

I have a survey that have calculations in it, when the data is published it shows properly on the report. 

But when I generate the customize report shows like this

My formula is correct because is showing 2 digits [if(selected(${OperatingTimeS},'Non - Operating Time'),(round(int((${TimeOS} - ${TimeSS})div(1000*60))div(60),2)),0)] in the PDF, but not in the customized report.

Another issue that I'm having is that at the end have a calculation of the repeated input, in this case is the sum of all the "Operationg Hours" and "Non operating hours". The formula is not showing the calculation how it's supposed to. 

Formulas

Generate those calculations, see that the "TotalSalt" and "TotalKM" are showing properly but not the first two.

Please if you can help me by telling me what I'm doing wrong.

Thanks.

0 Kudos
5 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Angelo,

Does the '0.25' data look correct in the data table?

Looking at the second question, it appears that the sum() function concatenated values instead of adding numbers to gather.  Are any of the fields being summed text, note, hidden, or calculate?  If so, you need to set the bind:type XLS column to the appropriate data type so that the form will process them correctly.

0 Kudos
AngeloCapriglione
New Contributor

Yes, it's correct (on the PDF report and the data table in excel), only when I generate the custom report it shows those extra 0.

In the custom template is like this.

And generate a report like this (see the "Hours" column for the extra 0).

In the matter of the second question. Those fields are calculated fields, not stored as a text. See link to view the survey (Survey CAAM)

Thanks.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Angelo,

I see the hours column has several other fields in it - are those values 0?  If so, you might be getting those visibly on the page - I would either use ${if } statements (see "Conditional Elements" in Feature report templates—Survey123 for ArcGIS | ArcGIS) or have a calculate column in the form bring the multiple question down to 1 question to use in the template.

On the other questions, calculate questions are treated as text - even if they used a numeric calculation to be populated, when accessed by other questions, text processing is used.  You will need to set the bind::type column to either integer or decimal for the sum() to work properly.

AngeloCapriglione
New Contributor

For the first one, the if statement for the report template work fine! Thanks.

In the other question, I see the column bind::type in the excel, but what do you mean with set that column to integer or decimal?

Do I need to type in the formula over there? or just adding the int(formula) in the calculation cell?

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Angelo,

The bind::type field sets the type of data when used in calculations in the form; the primary reason to use it if you have a text/note/calculate/hidden that contains numeric data.  You should see a dropdown for that field - the range is a little off (it'll be corrected in the next release), but you should be able to select 'int' or 'decimal' as the value.