Alteryx Designer Desktop Discussions

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

Create a sequence column (e.g C001,C002 and so on) for every unique row

Learner_Kat
6 - Meteoroid

Hi All,

I want to create a column  ,sequential code starting C001,C002 and so on for every unique entry of column workschedule code .

 

Workschedule Codesequential code
C5700001C001
C5700001C001
C5700001C001
C5700001C001
C5700001C001
C5700001C001
C5700001C001
C2000401C002
C2000401C002
C2000401C002
C2000401C002
C2000401C002
C2000401C002
C2000401C002
C6000001C003
C6000001C003

 

Can someone please help me with this.I am quite new to Alteryx and any help is greatly appreciated.

 

8 REPLIES 8
Amy_smart
11 - Bolide

Hi,

 

You can use the multi-row tool to do this.

 

Please refer to this blog post and view the 'Create Unique ID For Each Person in the Group' section.

 

If this works for you, please choose this as an accepted solution.

 

Thanks,

Amy

Learner_Kat
6 - Meteoroid

Would you please explain how to use the multi row tool. I am new to all this 

Yoshiro_Fujimori
15 - Aurora

@Learner_Kat 

 

Yes, Multi-Row Formula tool would be a straight-forward solution.

 

Sample workflow

SeqNo_1.png

Expression in Multi-Row Formula tool

IF [Row-1:Workschedule Code] != [Workschedule Code]
THEN [Row-1:SeqNo] + 1
ELSE [Row-1:SeqNo]
ENDIF

Amy_smart
11 - Bolide

Hi,

 

Please follow these steps:

 

1)On the Create New Field, type in 'sequential code'.

2) Next Num of Rows should be 1 and Values for Rows that Don't exist should be 0 or Empty

3) Group by 'Workschedule Code'

4) In the expression box type in '[Row-1 : sequential code']+1

5) Run the workflow

6) Use the formula tool and select your column and change it to a string. Enter the formula 'C' + [sequential code]

 

Thanks,

Amy

 

flying008
14 - Magnetar

Hi, @Learner_Kat 

 

Maybe you like this easy way.

 

录制_2023_08_04_08_02_53_684.gif

binuacs
20 - Arcturus

@Learner_Kat Another method

image.png

grazitti_sapna
17 - Castor

Hi Learner_Kat

you can try this way.

Thanks!

Sapna Gupta
Labels