# Number calculate

Dear all,

I have a grid question for calculate number below.

Q1. What price do you buy....beer in 1 case of cans?
We have 3 row:
Brand A
Brand B
Brand C

Q2A. What price do you sell...?
We have 2 row:
Brand A sell in 1 case of cans
Brand A sell in 1 can

Q2B and Q2C like Q2A.

My issue:
Q2A Brand A sell in 1 case of cans: Must be > Q1 Brand A.
Q2A Brand A sell in 1 can: Must be >= Q2A Brand A sell in 1 case of cans/24 (Q2Ar2 >= Q2Ar1 / 24)

Q2B and Q2C like Q2A.

Could you please let me know how to get this detail?

Thanks and sorry for my  weak English,
Vanna
asked Jan 5, 2018

## 1 Answer

0 votes
You can do this with custom JavaScript verification.  This verification should work for Q2A:

```if (SSI_GetValue('Q2A_r1_c1') <= [% Q1_r1_c1 %]) {
strErrorMessage = 'First Q2A error message here.';
}
else if (SSI_GetValue('Q2A_r2_c1') < [% Q1_r1_c1 / 24 %]) {
strErrorMessage = 'Second Q2A error message here.';
}
```
answered Jan 5, 2018 by Platinum (98,125 points)
Hi Zachary,

Thank you and well your answer but it's not clearly full my question in Q2A_r2_c1.
My question is:
- if Q2A_r1_c1 <= Q1_r1_c1 (error)
- if Q2A_r2_c1 < Q2A_r1_c1 / 24 (error)

Regards,
Vanna
My ques
I believe that's what my code does.  What incorrect behavior are you observing?
Yes sure, your code it's work but it's not second code error I wanted. Please you check my below code:

if (SSI_GetValue('Q2A_r1_c1') <= [% Q1_r1_c1 %]) {
strErrorMessage = 'First Q2A error message here.';
}
else if (SSI_GetValue('Q2A_r2_c1') < [% Q2A_r1_c1 / 24 %]) {
strErrorMessage = 'Second Q2A error message here.';
}

I want the second error is: Q2A_r2_c1 < Q2A_r1_c1 / 24

Many thanks,
Vanna