# First time user - Create a restriction

Hi,

I am first time user. I need help with something I think I am not

What I would like to do is to allow only people who fulfull one condition
to continue with the survey. This condition has to do with two variables,
one integer number (bigger than 1 million, called "id") and one text
variable (one digit, called "v").

Specifically, what I want to do is:
-Take the first digit of the integer number id (for example if it is
26.928.928 take the 2)
-Multiply it by 4 (2*4=8)
-Divided it by 3. (8/3)
-Calculate the remainder (2). The answer could be either 0,1 or 2.

If is different from 2, then the righ answers for v is 2.
If is 0 or 1, the right answer for v is x.

I would like to allow to the survey continue only people with the right

For the moment, I am creating a calculation row in the same page, "v2",
that has, in the calculation value, the next (i am using surveycto):

if(((int(substr(string(\${rut}), 0,1)))*4 mod 3)!=2,.=2,.=x)

But It appears that "Dependency cycles amongst the xpath expressions in
relevant/calculate", so I am not doing it right.

-Do you know why the expression is not working?
*-If it works, I imagine that it would create a new variable with the
results of the expression (2 where the reminder is different from 2 and x
if the result is *
2). How can I manage to stop the survey if this "v2" is different from
"v"?

Thanks a lot!

You will get more assistance if you attach an example XLSX file with just
where "x" came in.

··· On Mon, May 25, 2015 at 11:07 AM, wrote:

Hi,

I am first time user. I need help with something I think I am not

What I would like to do is to allow only people who fulfull one condition
to continue with the survey. This condition has to do with two variables,
one integer number (bigger than 1 million, called "id") and one text
variable (one digit, called "v").

Specifically, what I want to do is:
-Take the first digit of the integer number id (for example if it is
26.928.928 take the 2)
-Multiply it by 4 (2*4=8)
-Divided it by 3. (8/3)
-Calculate the remainder (2). The answer could be either 0,1 or 2.

If is different from 2, then the righ answers for v is 2.
If is 0 or 1, the right answer for v is x.

I would like to allow to the survey continue only people with the right

For the moment, I am creating a calculation row in the same page, "v2",
that has, in the calculation value, the next (i am using surveycto):

if(((int(substr(string(\${rut}), 0,1)))*4 mod 3)!=2,.=2,.=x)

But It appears that "Dependency cycles amongst the xpath expressions in
relevant/calculate", so I am not doing it right.

-Do you know why the expression is not working?
*-If it works, I imagine that it would create a new variable with the
results of the expression (2 where the reminder is different from 2 and x
if the result is *
2). How can I manage to stop the survey if this "v2" is different from
"v"?

Thanks a lot!

## --

You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an