Good morning. I am working now on a project were I use numeric tablette to collect data. I want to write a logic with permit to fill automatically the Id of manages, in order of their interview.
Please, some one can help me?
Provide id automaticaly
Re: Provide id automaticaly
You want the ID to be sequential? (first interview = 1, second = 2 etc)? Then you'll have a problem when merging the data if there's more than one tablet.. You could solve this by predefining a range or something (first interview on first tablet = 101, second interview on first tablet = 102 etc)..
But do you need the ID at all? If not: I like to use a combination of systime() and tablet ID/Interviewer ID. This way I'm guaranteed the ID is unique, and you'll know the order of the interviews from the size of systime() (if you need that).
If you still want sequential ID, I'd use an external file to write what was the last ID used, and then add one to this number for the next interview.
Anne
But do you need the ID at all? If not: I like to use a combination of systime() and tablet ID/Interviewer ID. This way I'm guaranteed the ID is unique, and you'll know the order of the interviews from the size of systime() (if you need that).
If you still want sequential ID, I'd use an external file to write what was the last ID used, and then add one to this number for the next interview.
Anne
Re: Provide id automaticaly
Thanks very much Anne. I want sequential ID. But, I don't know how to use the external file as you suggest in the third option.
Can you help me to do it please?
Thanks.
Can you help me to do it please?
Thanks.
Re: Provide id automaticaly
It is actually quite complicated: You do not want to make a new ID if you're in modify mode, and you don't want to write the ID to the file if you're not sure that the keyer really saves the record etc..
I think I wouldn't do this if I were new to CSPro
But what I suggest to do inestead, is to use the ID i suggested, and then - after data entry it would be easy to add a variable that is sequential that you can use as an ID in a batch job..
Anne
I think I wouldn't do this if I were new to CSPro
But what I suggest to do inestead, is to use the ID i suggested, and then - after data entry it would be easy to add a variable that is sequential that you can use as an ID in a batch job..
Anne