Weight of select_one user input

660
2
03-26-2018 08:50 AM
DragosDumitrescu1
New Contributor

Hello!

I'm working to make a survey on how  well prepared and inform is the population of a country to front a disaster.
In my survey i have 6 questions, first, each of this 6 questions has 2 arguments "yes=0.17 is for appling" and "no=0 is for not appling". Next, checking one of these 2 boxes, the value must update to the Count row in the calculation field, also under the Count row, i've added a calculate row to allow the calculation and update it to the Count row with one of the values 0.17 or 0( this values should be the user input for yes or no). The yes or no values are defined in Choices sheet. Next in my survey i need to display the weight *(Pondere aplicabilitate%) of the check answers, in the calculation of the calculate row i've used this function: ( if(sum( allcounts = 0, "" , count9/sum( allcounts)) and here i think is the problem...the counts are not defined to allow the formula to work, how should i go on ?

=IF(SUM(M9,M19,M28,M37,M46,M53)=0,"",M9/(SUM(M9,M19,M28,M37,M46,M53)))

 This should be the formula for the weight applicability.

The survey sheet with the 6 questions and the  parameters that are set for each question

The choices sheet, 0.17 and 0 for yes applicable and 0 not applicable..also  the other parameters

0 Kudos
2 Replies
JohnathanHasthorpe
Esri Regular Contributor

Hi Dragos

 

Survey123 does not use Excel formulas. You need to use the XLSForm Spec instead.

A couple of things to note on your calculations:

=IF(SUM(choices!F54,choices!F63,choices!F71,choices!F79,choices!F87,choices!F95)=0,"",choices!F54/(SUM(choices!F54,choices!F63,choices!F71,choices!F79,choices!F87,choices!F95,)))

  • Don't use = before an if() statement
  • Don't refer to excel cells - you need to refer to question names e.g. ${Calc_C4}
  • An if statement should be on the lines of if(condition, a, b) for example if(${q1}>0, 1, 0)
  • Don't use sum() in this context. You should use +. e.g ${Calc_C4} + ${Calc_C5}

Please take a look at the following for more background on the above

XLSForm essentials—Survey123 for ArcGIS | ArcGIS 

Formulas—Survey123 for ArcGIS | ArcGIS 

Thanks and let me know if you need any further clarification

John

DragosDumitrescu1
New Contributor

Cheers John and thank you very much !!

That was very, very useful and clearly explained, uhaaa !!

Have a nice day and cheers from Romania!

2018-03-28 3:44 GMT+03:00 Johnathan Hasthorpe <geonet@esri.com>:

GeoNet <https://community.esri.com/?et=watches.email.thread>

Re: Weight of select_one user input

reply from Johnathan Hasthorpe

<https://community.esri.com/people/JHasthorpe-esristaff?et=watches.email.thread>

in Survey123 for ArcGIS - View the full discussion

<https://community.esri.com/message/759918-re-weight-of-selectone-user-input?commentID=759918&et=watches.email.thread#comment-759918>

0 Kudos