Alteryx Designer Discussions

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

Unique Set of Numbers

dwilliams3
5 - Atom

Hi,

Can you please help me? I am trying to create a unique set of numbers in Alteryx as illustrated below. 

CurrentDesired
00
00
00
00
11
11
11
11
22
22
22
22
22
22
33
33
33
44
44
44
44
44
55
55
55
55
06
06
06
17
17
28
28
2 REPLIES 2
NicoleJohnson
14 - Magnetar
14 - Magnetar

So assuming that the "Current" column is in the order you want it to be, and you're looking to just increment by 1 for every new number change, I think you could do this with a Multi-Row tool. 

 

if [Current]=[Row-1:Current]

Then [Row-1:NewNumber]

Else [Row-1:NewNumber]+1

Endif

 

This formula would look to the row above and see if it was the same number. If it wasn't, it would increment the "NewNumber" by 1, otherwise it would just use the same NewNumber as above. If your data doesn't start at 0 in the current, you'll probably need to have another IF scenario for what to do for the first record of the data set... but otherwise, this will give you the answers you are looking for based on your sample data provided. 

 

NicoleJohnson_0-1635550229912.png

 

Hope that helps!! 

 

Cheers!

NJ

dwilliams3
5 - Atom

Thanks so much Nicole! This worked perfectly! Cheers!

Labels