Random numbers

Hi everyone,

We are working on a project in Ukraine that has a fair amount of logic and
a lot of case sharing. We have a baseline assessment form that determines
whether someone is eligible, based on certain scores on questionnaires. If
someone is eligible, I have a random number between 1-1000 generated and
assigned to them as their new study id number. We want to use this study id
number to track them throughout the course of the study. We also then have
another random number generated, and assign them to treatment or control
status based on a 2:1 ratio using that second random number. Here is the
logic for that: if(( eligible = 1) and ( random_num > 570), "control",
"treatment")

This is all working well in the app and the person administering the
questionnaire is notified during the process about the person's ID number
and whether they are assigned to treatment or control.

The problem comes in when they review the saved data. When you pull up
someone's saved baseline data using that study id number that was assigned,
and you scroll down to review their form and where their study id number
was assigned and which group they were assigned to, this all changes. That
means their ID number in the saved data changes everytime you open the form
to review. Same with their treatment assignment.

Is there anyway to fix these? The study ID is a case property, but is there
any way to fix these in the "saved data" so that people can review at the
end of the day how many people they got and which treatment condition they
were assigned to?

Thank you!!!
Emily

Auto Generated Inline Image 1 (43 Bytes)

Auto Generated Inline Image 1 (43 Bytes)

Hi Emily,

I'm a little confused by the behavior you're describing. Can you specify
what you mean when you describe reviewing their form, possibly by providing
screenshots of the steps you take? If this form has indeed been completed
and submitted then opening the form from the "Saved Forms" menu should not
change any values.

Cheers,
Will

Auto Generated Inline Image 1 (43 Bytes)

Auto Generated Inline Image 1 (43 Bytes)

··· On Thu, Nov 3, 2016 at 12:10 PM, Emily Haroz wrote:

Hi everyone,

We are working on a project in Ukraine that has a fair amount of logic and
a lot of case sharing. We have a baseline assessment form that determines
whether someone is eligible, based on certain scores on questionnaires. If
someone is eligible, I have a random number between 1-1000 generated and
assigned to them as their new study id number. We want to use this study id
number to track them throughout the course of the study. We also then have
another random number generated, and assign them to treatment or control
status based on a 2:1 ratio using that second random number. Here is the
logic for that: if(( eligible = 1) and ( random_num > 570), "control",
"treatment")

This is all working well in the app and the person administering the
questionnaire is notified during the process about the person's ID number
and whether they are assigned to treatment or control.

The problem comes in when they review the saved data. When you pull up
someone's saved baseline data using that study id number that was assigned,
and you scroll down to review their form and where their study id number
was assigned and which group they were assigned to, this all changes. That
means their ID number in the saved data changes everytime you open the form
to review. Same with their treatment assignment.

Is there anyway to fix these? The study ID is a case property, but is
there any way to fix these in the "saved data" so that people can review at
the end of the day how many people they got and which treatment condition
they were assigned to?

Thank you!!!
Emily

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Emlly,

Are you setting the random value in the hidden value "calculate" field or
in the "default value" field? I think setting it in the "Default Value"
will result in the behavior you are describing.

-Clayton

Auto Generated Inline Image 1 (43 Bytes)

Auto Generated Inline Image 1 (43 Bytes)

··· On Thu, Nov 3, 2016 at 2:57 PM, William Pride wrote:

Hi Emily,

I'm a little confused by the behavior you're describing. Can you specify
what you mean when you describe reviewing their form, possibly by providing
screenshots of the steps you take? If this form has indeed been completed
and submitted then opening the form from the "Saved Forms" menu should not
change any values.

Cheers,
Will

On Thu, Nov 3, 2016 at 12:10 PM, Emily Haroz eharoz@gmail.com wrote:

Hi everyone,

We are working on a project in Ukraine that has a fair amount of logic
and a lot of case sharing. We have a baseline assessment form that
determines whether someone is eligible, based on certain scores on
questionnaires. If someone is eligible, I have a random number between
1-1000 generated and assigned to them as their new study id number. We want
to use this study id number to track them throughout the course of the
study. We also then have another random number generated, and assign them
to treatment or control status based on a 2:1 ratio using that second
random number. Here is the logic for that: if(( eligible = 1) and (
random_num > 570), "control", "treatment")

This is all working well in the app and the person administering the
questionnaire is notified during the process about the person's ID number
and whether they are assigned to treatment or control.

The problem comes in when they review the saved data. When you pull up
someone's saved baseline data using that study id number that was assigned,
and you scroll down to review their form and where their study id number
was assigned and which group they were assigned to, this all changes. That
means their ID number in the saved data changes everytime you open the form
to review. Same with their treatment assignment.

Is there anyway to fix these? The study ID is a case property, but is
there any way to fix these in the "saved data" so that people can review at
the end of the day how many people they got and which treatment condition
they were assigned to?

Thank you!!!
Emily

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sorry, to clarify: "Will result in the correct behavior"

Auto Generated Inline Image 1 (43 Bytes)

Auto Generated Inline Image 1 (43 Bytes)

··· On Thu, Nov 3, 2016 at 2:59 PM, Clayton Sims wrote:

Emlly,

Are you setting the random value in the hidden value "calculate" field or
in the "default value" field? I think setting it in the "Default Value"
will result in the behavior you are describing.

-Clayton

On Thu, Nov 3, 2016 at 2:57 PM, William Pride wpride@dimagi.com wrote:

Hi Emily,

I'm a little confused by the behavior you're describing. Can you specify
what you mean when you describe reviewing their form, possibly by providing
screenshots of the steps you take? If this form has indeed been completed
and submitted then opening the form from the "Saved Forms" menu should not
change any values.

Cheers,
Will

On Thu, Nov 3, 2016 at 12:10 PM, Emily Haroz eharoz@gmail.com wrote:

Hi everyone,

We are working on a project in Ukraine that has a fair amount of logic
and a lot of case sharing. We have a baseline assessment form that
determines whether someone is eligible, based on certain scores on
questionnaires. If someone is eligible, I have a random number between
1-1000 generated and assigned to them as their new study id number. We want
to use this study id number to track them throughout the course of the
study. We also then have another random number generated, and assign them
to treatment or control status based on a 2:1 ratio using that second
random number. Here is the logic for that: if(( eligible = 1) and (
random_num > 570), "control", "treatment")

This is all working well in the app and the person administering the
questionnaire is notified during the process about the person's ID number
and whether they are assigned to treatment or control.

The problem comes in when they review the saved data. When you pull up
someone's saved baseline data using that study id number that was assigned,
and you scroll down to review their form and where their study id number
was assigned and which group they were assigned to, this all changes. That
means their ID number in the saved data changes everytime you open the form
to review. Same with their treatment assignment.

Is there anyway to fix these? The study ID is a case property, but is
there any way to fix these in the "saved data" so that people can review at
the end of the day how many people they got and which treatment condition
they were assigned to?

Thank you!!!
Emily

--
You received this message because you are subscribed to the Google
Groups "commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.