Count consecutive the number of occurences string

Hi Everybody, I have a question about counting in a consecutive way the number of occurences of a string "ELEMENT_TO_COUNT" , for instance: 

 

ELEMENT_TO_COUNT CONSECUTIVE_COUNTING Explanation  
A 1 This item appears 3 times  
A 2 This item appears 3 times  
A 3 This item appears 3 times  
B 1 This item appears 4 times  
B 2 This item appears 4 times  
B 3 This item appears 4 times  
B 4 This item appears 4 times  
C 1 This item appear 1 time  
D 1 This item appear 1 time  

I just need the column "CONSECUTIVE_COUNTING" and not the explanation

Thank you

Hi Mauu,

you can do this via looping and the moving aggregation node.

 

First construct a group loop using your Element to count as group columns.

Than use the Moving Aggregation node with the cumulative computation option and count as aggregation method.

Finally close the loop with a loop end.

I hope this helps.

Best, Iris 

Hi Iris thank you for the explanation, it worked perfectly and I am attaching the workflow.

Finally I recommend if you can upload a video about the Moving Aggregation node. 

Best Regards

 

1 Like