Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Skip error in V8

If someone could assist quickly, that would be greatly appreciated. Thanks.

In V7, I didn't have this problem? When I converted this survey to V8, I received errors like this ...

1. Error: Question 'Q16s' - Skip Logic - The binary operator '=' requires the same type on both the left and right sides. You have a Numeric on the left side and a String on the right.

2. Error: Question 'Q17a1' - Skip Logic - The binary operator '<' requires the same type on both the left and right sides. You have a Numeric on the left side and a String on the right.

The skip logic in all cases is similar and looks like this ...

Not (HdS1_CODE<5)

or

HdS1_CODE=1

Please note that HdS1_CODE is a free format hidden question that returns an integer number.

It looks something like this ...

<input name="HdS1_CODE" type="hidden" value="
[%
Begin Unverified Perl

 my $S1_code=0;
 
if ((VALUE("R2_1")==1)&&(NUMCHECKED("R2")==1))
 {
  $S1_code=1;
 }

elsif ((VALUE("R2_2")==1)&&(NUMCHECKED("R2")==1))
 {
  $S1_code=2;
 }

elsif ((VALUE("R2_3")==1)&&(NUMCHECKED("R2")==1))
 {
  $S1_code=3;
 }

elsif ((VALUE("R2_4")==1)&&(NUMCHECKED("R2")==1))
 {
  $S1_code=4;
 }

else
 {
  $S1_code=71;
 }

return $S1_code;
 
End Unverified
%]
">

For some unknown reason, the skip logic is confusing the hidden question HdS1_CODE as being of type text?
asked Nov 2, 2013 by Paul Moon Platinum (61,560 points)
edited Apr 3, 2014 by Walter Williams

1 Answer

+1 vote
Go to Free format question, double click variable name, click numeric as type
answered Nov 2, 2013 by Saurabh Aggarwal Gold (28,975 points)
Thanks. That fixed the problem. I didn;t see that new option there.
I'm getting the same error on one particular question - even though, all other skip logic operations work. I did not use any free format questions. Just normal select questions. Like I said, all skip logics work but now one operation (Q11 > 1) gives me this error. Can you help me?
Is Q11 a single response or multiple response select question? A single response is expecting something like Q11>1 but a multiple response needs Q11_2=1 for example.

And if Q11 is something else like a grid or constant sum, then you need to refer to it correctly rather than just Q11.
Thank you. It was indeed a multiple response question and the "_x" code did fix my problem!
Ah yes, I suspected a question reference issue. Glad to see you are now sorted out.
...