Alteryx Designer

Find answers, ask questions, and share expertise about Alteryx Designer.
Register for the upcoming Live Community Q&A Session - and don't forget to submit your questions for @DeanS regarding the future role of analytics here.

Create my own custom ID field

6 - Meteoroid

Dear All,


Im trying to make a new custom record field, so that it looks this A01, A02, A03 and so on. Currently the Record ID tool is only displaying without me being able to make any changes to it.


Any idea how?


Thank You.

Alteryx Certified Partner
Alteryx Certified Partner

Use the recordID to generate your numbers, then you can use a formula tool to add the letter prefix as you desired.


I suspect it's more complex than this mind.



6 - Meteoroid

So lets say the output field is [Customer ID]

and [Customer ID_t] is a temporary field generated by the Record_ID tool.

All fields are set to vstring.


I tried this:


if [Customer ID_t]<="9" Then
PadLeft([Customer ID_t], 0, "C0")
PadLeft([Customer ID_t], 0, "c")


But the output is still 1,2,3,4 in the Customer ID field.

Alteryx Certified Partner
Alteryx Certified Partner

It appears your pad statement is incorrect.

The purpose of the PADLEFT function is too add the values in the 3rd part of the statement until the character length reaches that expressed by the 2nd part of the statement. 


You don't really need the if statement, it should be something like...

"C"+padleft([Customer ID_t],3,"0")


Make sure you convert the customer ID_t field to a string beforehand.

Alternatively if the padding needs to be more dynamic based on the number of ID's you can try the approach in the example attached.

This should also help you come to the solution.


6 - Meteoroid

Thanks a lot, I realised that the if else statement was needless. Thanks.

Also that my padleft statement was wrong.


It works now.


Thank You :)