Unique ID creation

Hii,

I want to create many unique ID as per the below pattern

‘MSSCDN-202001’
‘MSSCDN-202002’
‘MSSCDN-202003’
‘MSSCDN-202004’
‘MSSCDN-202005’

What formula should I use to get this unique IDs?

As a rule of thumb, you shall avoid using/creating sequential keys or numbers as 2 or more users creating a record at the same time, can create 2 or more identical keys/numbers and there’s no way to avoid that. Therefore; basically you can provide it with this:

CONCATENATE(
	"MSSCDN-",
	NUMBER(
		MID(
			LOOKUP(MAX(TableName[_RowNumber]),"TableName","_RowNumber","Key"),
			(FIND("-",LOOKUP(MAX(TableName[_RowNumber]),"TableName","_RowNumber","Key")) + 1),
			LEN(LOOKUP(MAX(TableName[_RowNumber]),"TableName","_RowNumber","Key"))
		)
	) + 1
)

BUT YOU SHOULDN’T!


4 Likes