# Logic check with 3 questions

Dear All,

I have 3 grids question as below:

Q1 Grid format (Row base), there are 5 rows:
Q1Row1 - Yes or No
Q1Row2 - Yes or No
Q1Row3 - Yes or No
Q1Row4 - Yes or No
Q1Row5 - Yes or No

Q2 Grid format (Row base), there are 3 rows

Q2Row1 - Yes or No
Q2Row2 - Yes or No
Q2Row3 - Yes or No

I have created construction list for Q2 like this
If Q1Row2 = No we add Q2Row1.
If Q1Row3 = No we add Q2Row2.
If Q1Row4 = No we add Q2Row3.

Q3 Grid format (Column base), there are 2 columns need input number . In Q3 we show all rows.

Column 1        |        Column 2
Q3Row1 -    Input Number   |    Input Number
Q3Row2 -    Input Number   |    Input Number
Q3Row3 -    Input Number   |    Input Number
Q3Row4 -    Input Number   |    Input Number
Q3Row5 -    Input Number   |    Input Number

Here the logic check and show error message:

If Q1Row1 = No and  Q3Row1Col1 > 0 => Error message
If Q1Row2 = No and  Q3Row2Col1 > 0 => Error message
If Q1Row3 = No and  Q3Row3Col1 > 0 => Error message
If Q1Row4 = No and  Q3Row4Col1 > 0 => Error message
If Q1Row5 = No and  Q3Row5Col1 > 0 => Error message

If Q2Row1 = No and  Q3Row2Col2 > 0 => Error message
If Q2Row2 = No and  Q3Row3Col2 > 0 => Error message
If Q2Row3 = No and  Q3Row4Col2 > 0 => Error message

Is it possible? and how can i fix this?
retagged Jan 24, 2018
Can you help me understand how Q3 rows are selected? Are they an amalgam of Q1 and Q2? Can you create another constructed list that pulls only the relevant Rows for Q3?

+1 vote

Here is the first Q1 verification and first Q2 verification:

```if ([% Q1_r1 %] == 2 && SSI_GetValue('Q3_r1_c1') > 0) {
strErrorMessage = 'Error message here';
}

if ('[% Q2_r1 %]' == '2' && SSI_GetValue('Q3_r2_c2') > 0) {
strErrorMessage = 'Error message here';
}
```

Those can be copy-and-pasted for each Q1 and Q2 row, respectively.
answered Jan 24, 2018 by Platinum (100,575 points)
selected Jan 26, 2018 by Saroeun