Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Announcement | We'll be doing maintenance between 2-3 hours, which may impact your experience. Thanks for your patience as we work on improving the community!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Creating a unique code

Sammy22
8 - Asteroid

Hello

 

i want to create a unique code using the date and the food fields as below. The code would begin with AB, then it would take the day and month part of the date for example 0204 for 02/04/2021, then it would take the last 3 characters of the food field and then it would have a - followed by record count for that date and food (as there are 3 bread on 02/04/21 then the 3 records would end with a 1,2 and 3).

 

DateFoodCode
2/4/2021BreadAB0204EAD-1
2/4/2021BreadAB0204EAD-2
2/4/2021BreadAB0204EAD-3
2/4/2021BreadAB0204EAD-4
2/8/2021EggsAB0208GGS-1
2/8/2021EggsAB0208GGS-2
3/18/2021MilkAB0318ILK-1
3/18/2021MilkAB0318ILK-2
2 REPLIES 2
Felipe_Ribeir0
16 - Nebula

Hi @Sammy22 

 

Here is a way of doing this:

Felipe_Ribeir0_0-1664538755817.png

If the provided answer helped you to solve the problem/was correct, please accept it as a solution :)

 

Thanks.

JamesCharnley
13 - Pulsar

I'd use a combination of multi-row to create a tag for the food and then a formula to handle putting together the string.

JamesCharnley_0-1664538924428.png

JamesCharnley_1-1664538945611.png

 

 

Labels