SOLVED
Providing Unique Reference for new items
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
PassION_es
10 - Fireball
‎07-23-2024
01:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have a dataset where each new items will be given a unique reference number. I want the new items to be recorded with a new reference number following the last reference number. Please see below example
Input file:
Existing Record
Name - Reference
Aela - AM000097
Erza - AM000098
New Items to be Added in the Record:
Cloud
Lexy
Output in Alteryx:
Name - Reference
Aela - AM000097
Erza - AM000098
Cloud - AM000099
Lexy - AM000100
Each should have an alpha-numeric characters of upto 8 characters only (AM000000).
Thank you in advance.
Solved! Go to Solution.
Labels:
- Labels:
- Datasets
- Documentation
- Input
- Regex
3 REPLIES 3
flying008
15 - Aurora
‎07-23-2024
01:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi, @PassION_es
FYI.
IIF(IsEmpty([Reference]), Left([Row-1:Reference], 2) + PadLeft(ToString(ToNumber(Right([Row-1:Reference], 6)) + 1), 6, '0'), [Reference])
binuacs
21 - Polaris
‎07-23-2024
01:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@PassION_es one way of doing this
‎07-23-2024
02:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
thank you @flying008 and @binuacs
![](/skins/images/1AD6617C767659D8A9F9801BEDFCFB20/responsive_peak/images/icon_anonymous_message.png)