Have an idea?

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

My Grid Logic with 3 ROWs

Dear Guy,

I have a grid questions have 3 rows in numeric format.
Row1: input number of product
Row2: input number of product display
Row3: input number of sale per week

Here is the logics:

Row2 <= Row1, if error show message.
Row3 <= Row1+Row2, if error show message.
asked Aug 17 by Saroeun

1 Answer

0 votes
Saroeun,

If you use this in the Custom Javascript area it should give you what you need.  This is an example for a 3 row grid question with one column, set to rows and all as numeric input.  The question name is "Grid".

var Row1=SSI_GetValue("Grid_r1_c1");
var Row2=SSI_GetValue("Grid_r2_c1");
var Row3=SSI_GetValue("Grid_r3_c1");

if(Row3<=(Row1 + Row2))
 {strErrorMessage="Row3 must be greater than Row1 & Row2 Combined";}

if(Row2<=Row1)
 {strErrorMessage="Row2 must be greater than Row1";}.
answered Aug 17 by Jay Rutherford Gold (21,905 points)
Thanks Jay,

Do you have another way? as this way i already done but didn't work.
I don't.  I've tested this a number of times and it's working/calculating fine on my end.  Have you tried setting an alert to make sure it's evaluating the variables correctly?
...