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
C1 | C2 | C3 | C4 |
Tree | Plant | Bush | Sapling |
Output Required
C | Code |
Tree | 101 |
Plant | 1011 |
Bush | 10111 |
Sapling | 101111 |
@Disha03
I am not sure your code naming convention here. so just go with the straightforward way.
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
C1 | C2 | C3 | C4 |
x | x1 | x2 | x3 |
y | y1 | y2 | y3 |
z | z1 | z2 | z3 |
Output Expected:
C | Code |
x | 101 |
x1 | 1011 |
x2 | 10111 |
x3 | 101111 |
y | 102 |
y1 | 1021 |
y2 | 10211 |
y3 | 102111 |
z | 103 |
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