Hi,
My situation: I have a table with some columns in one of them there are Names that repeats. I want to count each one of them into groups and I can do that with GroupBy node but I can not find solution that each group count starts from 0 so from start.
Column 1
A
B
A
C
D
D
D
B
A
I want to create column that will show me following result:
A 0
A 1
A 2
B 0
B 1
C 0
D 0
D 1
D 2
All I can get so far is
A 3
A 3
A 3
B 2
B 2
C 1
D 3
Thanks in advance.
Hi, in an attachment, you can find 2 solutions to your problem. The first idea is to: 1. Sort your table by column with names 2. Use a "math formula" node to add ROWINDEX field 3. Use "groupBy" node to find the minimum value of ROWINDEX for each Name 4. Join result in the original table and subtract min(ROWINDEX) from ROWINDEX field. The second idea is simpler — use “Group Loop Start” node and in each iteration use "math formula" to add ROWINDEX. In other hand, you can use "Java Snippet" node and just write your own Java code to count occurrences of each Name. If your table is huge, this (probably) will be faster than first 2 solutions.