Page 1 of 1

Auto generate farm Id number from Number of Farms in a given roster

Posted: February 14th, 2020, 6:36 am
by lmoriba
Dear CSPRO community,

I need an urgent help. Am doing doing a survey on farmers: basically collecting information on the farmers, the number of farm plots and the location of each farm plot. I want to use number of plots to auto generate the plot ids of each farmer before i can move to the next farmer. If that is not possible then I want a consistency check for each farmer, based on his total number of farms to ensure that a count of the farm ids equals the total number of farms for that farmer.

I have attached my questionnaire, filled one in excel to illustrate my example.

Re: Auto generate farm Id number from Number of Farms in a given roster

Posted: February 14th, 2020, 7:32 am
by etuser
Dear Sir,

Here i tried to re-arrange your entry form, Please see the attached file .

Cheers

Re: Auto generate farm Id number from Number of Farms in a given roster

Posted: February 14th, 2020, 1:26 pm
by lmoriba
Many thanks Etuser. Thanks for your prompt response. Is good to know of a solution when you rearrange the questions. That's okay 😊.

However, I am seeking for a solution when you don't arrange the questions. I want a solution: if it will be possible to generate the farmId from the number of farms or a check to ensure that the count of the farmIds doesn't exceed the number of farms for each farmer on the roster.

Re: Auto generate farm Id number from Number of Farms in a given roster

Posted: February 18th, 2020, 8:18 am
by aaronw
I've attached an example solution. I've made each farmer's information its own case. CSPro was not designed to have one case for the entire survey.

Next, I organize the questionnaire into two records. One singly occurring record where the farmer's name and total plots is collected. Then a second multiply occurring record where I prefill the plot id and location description. When the number of occurrences in the FARM_DETAILS_REC is greater than the total plots the roster ends (and so does the case).

Walk through the survey and let me know if you have any questions.