Survey 123 percentage constraint

1474
2
Jump to solution
07-16-2020 11:47 AM
SarahHartholt
Occasional Contributor III

I have created a survey in survey 123 connect. I would like respondents to answer questions about their total internet usage. The questions are currently stored on 4 lines (the first line is read only) and I would like the responses to add up to 100. Is this possible with a calculation in the constraint column or by some other means?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
DougBrowning2
Occasional Contributor III

Yes I do this a lot.

Create a read only field call Total %.

Add then up in the calculation column  can use float also if needed or use the bind to int.  Mine are 10,20,30 etc choice box so this works

  int(${BankVegCoverFoliar}) + int(${BankCobbleCover}) + int(${BankLargeWoodCover}) + int(${BankBedrockCover})

Put a constraint on the Total field of 

.=100

Hope that helps

View solution in original post

2 Replies
DougBrowning2
Occasional Contributor III

Yes I do this a lot.

Create a read only field call Total %.

Add then up in the calculation column  can use float also if needed or use the bind to int.  Mine are 10,20,30 etc choice box so this works

  int(${BankVegCoverFoliar}) + int(${BankCobbleCover}) + int(${BankLargeWoodCover}) + int(${BankBedrockCover})

Put a constraint on the Total field of 

.=100

Hope that helps

DAVIDMCCOTTER48
New Contributor II

If I use the keypad widget to select integers, but then do not pick a number it clears the value for that field.

I've event set the default value of each integer field to zero.

Even casting the empty value as an int i.e. int(${fieldname}) and setting bind:type to int allows me to bypass this validation.

Any suggestions?

0 Kudos