Icon

auto incrementing number based on specific column value

Auto incrementing number based on specific column value

The sample data is a list of values, containing zero on some rows.

In this example, whereever there is a zero, we treat this as the end of a group of rows, and we then want to assign auto-incrementing IDs to each group.


In our example, the zero represents "end of group" and so we need to introduce a lag column to ensure the zero value is in the correct group.

In other cases a "boundary marker" might represent "start of group". If it represents "start of group" there is no need to include the lag column.

The sample data is a list of values, containing zero on some rows.In this example, whereever there is a zero, we treat this as the end of a group of rows,and we then want to assign auto-incrementing IDs to each group.In our example, the zero represents "end of group" and so we need to introduce a lagcolumn to ensure the zero value is in the correct group.In other cases a "boundary marker" might represent "start of group". If it represents "startof group" there is no need to include the lag column. sample datafind the boundary markersand set a value to 1for those, otherwise 0cumulatively sum the"1" boundary markersif boundary needs to mark"end" rather than beginningwe lag the previous "sum(boundary marker)" columnChoose your group IDExample of how you could use the group Id to create an "invoice number".In this example, the first invoice numberis INV0001050 and we want to auto-increment from thereTidy UpPopulate missing"lag" for first row Table Creator Rule Engine Moving Aggregation Lag Column Column Rename String Manipulation Column Filter Missing Value The sample data is a list of values, containing zero on some rows.In this example, whereever there is a zero, we treat this as the end of a group of rows,and we then want to assign auto-incrementing IDs to each group.In our example, the zero represents "end of group" and so we need to introduce a lagcolumn to ensure the zero value is in the correct group.In other cases a "boundary marker" might represent "start of group". If it represents "startof group" there is no need to include the lag column. sample datafind the boundary markersand set a value to 1for those, otherwise 0cumulatively sum the"1" boundary markersif boundary needs to mark"end" rather than beginningwe lag the previous "sum(boundary marker)" columnChoose your group IDExample of how you could use the group Id to create an "invoice number".In this example, the first invoice numberis INV0001050 and we want to auto-increment from thereTidy UpPopulate missing"lag" for first rowTable Creator Rule Engine Moving Aggregation Lag Column Column Rename String Manipulation Column Filter Missing Value

Nodes

Extensions

Links