Skip to main content
Question

Creating A Unique ID

  • June 4, 2020
  • 0 replies
  • 32 views

Hi All,

I was running into a problem in creating a Unique ID

The way we create a Unique ID in out business right now is as follows:

First 2 letters is the Region: PC=Pacific; PR=Prairies; EA=Eastern; MI=Michigan;
Next 4 numbers is the year: ie 2020;
Next 2 is the loss: Personal Workplace Injury=PI; Property Damage=PD; Vehicle Accident=VA; Environmental Loss=EV; Liability Claim=LI; Compliance=CO; Security=SC;
The Next two number is the month the loss happened ie January=01, February=02; the next 2 numbers is how many of that type of loss there was in that month;
Finally if the vehicle accident in February was the 4th vehicle accident in that region that month it would show 02-04

For a final product of EA-2020-VA-05-04

My Current script is as follows:

var text a=If([Location - Zone] = "Eastern","EA",
[Location - Zone]= "Michigan","MI",
[Location - Zone]= "Pacific","PC",
[Location - Zone]= "Prairies","PR","N/A");

var number b=Year([Date & Time of Incidient]);

var text c=If([Type of Loss]="Workplace Injury","PI",
[Type of Loss]="Property Damage","PD",
[Type of Loss]="Compliance","CO",
[Type of Loss]="Environmental","EV",
[Type of Loss]="Liability","LI",
[Type of Loss]="Sercurity","SC",
[Type of Loss]="Vehicle Accident","VA","N/A");

var number d=Month([Date & Time of Incidient]);
var number dOne=ToNumber(PadLeft(ToText($d),3,"0"));

var number e=???????


ToText ($a&"-"&$b&"-"&$c&"-"&$dOne&"-"&$e)

Can anyone help in in figuring out what I would need to do to finish the final argument?

Thanks in Advance!


------------------------------
Ryan Persaud
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24
If you question is how to sting them together separated by a dash

List("-", $a, $b, $c, $dOne, $e)

 you can choose any thing in those quotes as the separator character(s)

------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------