I'm attempting to build a network based on the 'From' and 'To' columns. Essentially, each number in the 'From' column is connected to a corresponding number in the 'To' column. Subsequently, I need to locate this 'To' number in the next 'From' column and identify its associated 'To' value. I must repeat this process, finding the second 'To' value within the next 'From' value and determining its corresponding 'To' value. However, there's a condition: the 'To' value must always be greater than the 'From' value.
1 Answer
I'm not sure I understand fully, because in your example I'm not sure how the second output is 1-5-8.
However, this may help somewhat. Firstly, place an AttributeManager. Open the parameters and expand the section on Advanced Attribute Value Handling. Check the Enable Adjacent Feature Attributes box and enter 1 into the Number of Subsequent Features Field:
Now you can create a new Output attribute that is a combination of the current row's From/To values, plus any of the next row's attributes. You reference them using feature[+1].from and feature[+1].to
For example: @Value(From)-@Value(To)-@Value(feature[+1].To)
You said you need to get the "'To' number in the next 'From' column", which is what this does. It fetches the To column in the next row.
I'm hoping that this solves the problem or at least gets you in the right direction. If you want to read the prior or next values of an attribute, this is probably the best way to do it. If you want a record that is further out, then increase the number of subsequent features from 1.
-
Hey @MarkIreland , thank you for your response. Had the sequence been like the value in 'To' equal to subsequent 'From' value, this would have worked, however, the chain is in ascending order of 'From' values. Sorry for the confusion in image, updated now. Actual data path: community.safe.com/s/feed/0D5Dm00000VUv1vKADHellblaZer– HellblaZer2023-06-07 08:54:15 +00:00Commented Jun 7, 2023 at 8:54

