I am trying to create a hidden value that will allocate cases to one of
three groups:
I first create a random integer from 1:3:
d0010_randnum = int(random() * 3) + 1
Then I create a second hidden value to allocate the case to a group:
d0011_randout = if((#form/d0010_randnum = 1), "Group_1",
if(#form/d0010_randnum = 2, "Group_2"), "Group_3")
Finally I display a label
"This participant has been randomised to: "
However, displayed label doesn't appear to match the data saved.
Are you loading the "d0010_randnum" hidden value into a calculation
or a default
value? Random values should be loaded into the default value, which is
only ever evaluated once when the form begins, which may correct the issue
that you're seeing.
-Clayton
ยทยทยท
On Fri, Oct 20, 2017 at 9:24 AM, petermacp wrote:
Hi,
I am trying to create a hidden value that will allocate cases to one of
three groups:
I first create a random integer from 1:3:
d0010_randnum = int(random() * 3) + 1
Then I create a second hidden value to allocate the case to a group:
d0011_randout = if((#form/d0010_randnum = 1), "Group_1",
if(#form/d0010_randnum = 2, "Group_2"), "Group_3")
Finally I display a label
"This participant has been randomised to: "
However, displayed label doesn't appear to match the data saved.