Alteryx Designer Desktop Discussions

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

SPLIT rows based on row value

flojosx
7 - Meteor

Hi All, 

I have to generate Consumer IDs based on the number of customers in a category. So I like to go from 

GroupNo. of costumers
A2
B3
C5

 

To

IDGroupNo. of costumers
ID10001A2
ID10002A2
ID10003B3
ID10004B3
ID10005B3
ID10006C5
ID10007C5
ID10008C5
ID10009C5
ID10010C5

I tried the generate row tool but somehow I got way too many records. Any help would be appreciated. Thank you so much for your help.

3 REPLIES 3
neilgallen
12 - Quasar
Using the generate rows tool along with a record I’d would get you the results you need.

You could use the generate records tool where the condition is <= your number of customers field. All other values could be the same as the default.

After making the right number of rows, then add a record ID tool to make your ID field.
flojosx
7 - Meteor

Thanks you so much for the quick reply! this worked. I was doing the same thing but was using a min (0) and max (customer number) column which resulted in waaaay too many column. the defaults worked. Thank you!

Thableaus
17 - Castor
17 - Castor

Hi @flojosx 

 

Here's a possible way to do it:

 

likethis.PNG

 

- Use generate rows to generate the row until No. of Customers (RowCount <= [No. of costumers])

- Use RecordID starting at 10000, string size of 5

- Change the string size to 7, remove RowCount with the Select Tool

- Use Formula Tool to add the "ID" string to Record ID

 

WF attached.

 

Cheers,

Labels