Alteryx Designer Desktop Discussions

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

How to generate sequences from columns and convert into a list

Disha03
6 - Meteoroid

Hi Everyone,

 

I need to generate codes for the data I have in four columns and have to create a list by generating codes.

 

Input

C1C2C3C4
TreePlantBushSapling

 

Output Required

CCode
Tree101
Plant1011
Bush10111
Sapling101111
3 REPLIES 3
Qiu
21 - Polaris
21 - Polaris

@Disha03 
I am not sure your code naming convention here. so just go with the straightforward way.

0317-Disha03.PNG

Disha03
6 - Meteoroid

This is only working when we have one row.

 

In case of 1,000s of categories where we need codes to change automatically by identifying next category this workflow will not work.

 

Input

C1C2C3C4
xx1x2x3

y

y1y2y3
zz1z2z3

 

Output Expected:

CCode
x101
x11011
x210111
x3101111
y102
y11021
y210211
y3102111
z103
danilang
19 - Altair
19 - Altair

Hi @Disha03 

 

To modify @Qiu's workflow to work with multiple input rows, 

 

1.  Add a RecordID tool before the transpose and call this new field RowID

 

2. Change the original RecordID tool to a multi-row

   a. creating a field called tool RecordID

   b. grouped by RowID

   c. use [Row-1:RecordID]+1 as the formula to generate sequential ids within each RowID 

 

2. In the original Multirow tool, 

   a. Group by RowId

   b. Modify the to use the RowID in the initial part of the code.

 

Dan   

Labels