Unique case numbers

Good morning all!

I am creating an app for outreach workers working with orphans and
vulnerable children, and need to make unique case numbers for each case.
Is this possible? How do I do it?

Many thanks!
Erika

you can use the coalesce function eg:

coalesce (your_id,0)+1

this will generate a unique id that increments by 1 for each new entry.

please note that you reference your_id from the cases and not question id

good luck

eva

··· ________________________________ From: commcare-users@googlegroups.com on behalf of berube.erika@gmail.com Sent: Friday, March 31, 2017 9:44 AM To: commcare-users Subject: Unique case numbers

Good morning all!

I am creating an app for outreach workers working with orphans and vulnerable children, and need to make unique case numbers for each case. Is this possible? How do I do it?

Many thanks!
Erika


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.commailto:commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Eva,

Thanks for your answer. When you say your_id, can this be for example the
child’s dob? If I have two kids with the same dob, would they end up with
the same or different unique ID numbers?

Erika

··· On Friday, March 31, 2017 at 1:04:39 PM UTC+2, Eva Chigodo wrote: > > you can use the coalesce function eg: > > > coalesce (your_id,0)+1 > > > this will generate a unique id that increments by 1 for each new entry. > > > please note that you reference your_id from the cases and not question id > > > good luck > > > eva > > > ------------------------------ > *From:* commcar...@googlegroups.com < > commcar...@googlegroups.com > on behalf of > berube...@gmail.com <berube...@gmail.com > > *Sent:* Friday, March 31, 2017 9:44 AM > *To:* commcare-users > *Subject:* Unique case numbers > > Good morning all! > > I am creating an app for outreach workers working with orphans and > vulnerable children, and need to make unique case numbers for each case. > Is this possible? How do I do it? > > Many thanks! > Erika > > -- > 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-user...@googlegroups.com . > For more options, visit https://groups.google.com/d/optout. >

Hie Erika sorry I was offline…

What I am suggesting is that child number 1 can be assigned number 1, child 2 number 2…child n number n.

This means that regardless of some children sharing the same birthday they will each have a unique identifier based on when they were registered in the system

Eva

··· ________________________________ From: commcare-users@googlegroups.com on behalf of berube.erika@gmail.com Sent: Saturday, April 1, 2017 3:03 PM To: commcare-users Cc: ETChigodo@outlook.com Subject: Re: Unique case numbers

Hi Eva,

Thanks for your answer. When you say your_id, can this be for example the child’s dob? If I have two kids with the same dob, would they end up with the same or different unique ID numbers?

Erika

On Friday, March 31, 2017 at 1:04:39 PM UTC+2, Eva Chigodo wrote:

you can use the coalesce function eg:

coalesce (your_id,0)+1

this will generate a unique id that increments by 1 for each new entry.

please note that you reference your_id from the cases and not question id

good luck

eva


From: commcar...@googlegroups.com commcar...@googlegroups.com on behalf of berube...@gmail.com berube...@gmail.com
Sent: Friday, March 31, 2017 9:44 AM
To: commcare-users
Subject: Unique case numbers

Good morning all!

I am creating an app for outreach workers working with orphans and vulnerable children, and need to make unique case numbers for each case. Is this possible? How do I do it?

Many thanks!
Erika


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-user...@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.commailto:commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Eva,

Thanks so much. How do I make it sequential like that so that child nis
number dob+n? Does the coalesce function do that automatically?

:slight_smile: Erika

··· On Monday, April 3, 2017 at 10:37:56 AM UTC+2, Eva Chigodo wrote: > > Hie Erika sorry I was offline... > > > What I am suggesting is that child number 1 can be assigned number 1, > child 2 number 2.....child n number n. > > > This means that regardless of some children sharing the same birthday they > will each have a unique identifier based on when they were registered in > the system > > > Eva > ------------------------------ > *From:* commcar...@googlegroups.com < > commcar...@googlegroups.com > on behalf of > berube...@gmail.com <berube...@gmail.com > > *Sent:* Saturday, April 1, 2017 3:03 PM > *To:* commcare-users > *Cc:* ETCh...@outlook.com > *Subject:* Re: Unique case numbers > > Hi Eva, > > Thanks for your answer. When you say your_id, can this be for example the > child's dob? If I have two kids with the same dob, would they end up with > the same or different unique ID numbers? > > Erika > > On Friday, March 31, 2017 at 1:04:39 PM UTC+2, Eva Chigodo wrote: >> >> you can use the coalesce function eg: >> >> >> coalesce (your_id,0)+1 >> >> >> this will generate a unique id that increments by 1 for each new entry. >> >> >> please note that you reference your_id from the cases and not question id >> >> >> good luck >> >> >> eva >> >> >> ------------------------------ >> *From:* commcar...@googlegroups.com on >> behalf of berube...@gmail.com >> *Sent:* Friday, March 31, 2017 9:44 AM >> *To:* commcare-users >> *Subject:* Unique case numbers >> >> Good morning all! >> >> I am creating an app for outreach workers working with orphans and >> vulnerable children, and need to make unique case numbers for each case. >> Is this possible? How do I do it? >> >> Many thanks! >> Erika >> >> -- >> 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-user...@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-user...@googlegroups.com . > For more options, visit https://groups.google.com/d/optout. >