Hello,
I need to assign row number to groups of data in a table. My table is like this:
Product | Category | Attribute | Value |
100123 | Cat1 | Att1 | Blue |
100123 | Cat1 | Att1 | Green |
100123 | Cat1 | Att1 | Yellow |
100123 | Cat1 | Att1 | Orange |
100127 | Cat2 | Att1 | Power Wash |
100127 | Cat2 | Att1 | Oil Change |
100127 | Cat2 | Att1 | Fluids Top-up |
100130 | Cat1 | Att2 | Stainless Steel Drum |
100130 | Cat1 | Att2 | Programable Timer |
100130 | Cat1 | Att2 | Fuzzy Logic |
100130 | Cat1 | Att2 | Auto Shut-off |
100130 | Cat1 | Att2 | Water Saving |
100135 | Cat2 | Att1 | Power Wash |
100135 | Cat2 | Att1 | Oil Change |
I need a new Position column that starts from zero and increments by 1 for each item in the group. I was able to add the increments using a Multi-row formula, but I don't know to start the numbering from zero. Can anyone suggest how I can do that?
I have attached my workflow to the question.
Solved! Go to Solution.
hi @thd-data-analyst
You can achieve this with the recordID tool!
I have attached a workflow with this included.
Let me know if i can help any further
Thank you @TheOC the recordid has applied the row number to the whole table starting with zero. I need to the row number to be applied to the groups of data. For example, if you run my original workflow you will see that it assigns the numbers starting with 1 for separate groups of rows where the only thing that changes is the Value column. I need the row numbers to be assigned to the groups, but should start from zero instead of 1.
I have done a minor change in your workflow to start from zero
I have added a formula tool and done
[Position]-1
Output:
It not possible that easily to directly integrate it in the Multi-row formula tool itself
Hope this helps 🙂
If this post helps you please mark it as solution. And give a like if you dont mind 😀👍
@atcodedog05, thank you, this works.
hi @thd-data-analyst
Ah yes! Sorry my silly mistake, I didn't see that part of your multi-row formula. I believe @McEleavey has been working on a tool that allows for grouping by field on the record id tool, which sounds perfect for this case!
Alternatively, I would have done something like what @atcodedog05 has done
Thank you @TheOC , the tool you mentioned does sound like the perfect solution. How can I access the same?
Hi @TheOC
Tile tool Tile sequence gives the similar effect of Record ID on grouby. It can be used alternatively.
Hi @thd-data-analyst !
I believe this tool is still being worked on, but your best bet would be to message/follow him directly, whether on these forums or on his twitter (where i saw the tool mentioned): https://twitter.com/ChrisMacBP/status/1315016212582203392
Alternatively, as @atcodedog05 has said, the tile tool can be used for this, and heres an example