Skip to main content

I am trying to leverage the 'Adjacent Feature Attributes' function in AttributeManager to generate a list of unique IDs (UID) for a set of records. In this example I have generated a UID for a single record based on if the record in 'col0' contains a "G" and concatenating the CSV Line Number with 'col2' (this is a timestamp, so I removed the colons to avoid issues down the line).

 

I now want to replicate that _UID_G field to the other records until I hit another 'G' type record to ultimately look like this:

 

Here is my issue: the number of CSV Lines between records that have 'G' in col0 can fluctuate for each CSV that I run. I am trying to dynamically set the Number for Prior Features in the AttributeManager:

 

 

I think I need to build a list from the CSV file I am using first, then figure out how to count the number of records that exist between each "G" feature. From there I can use a TestFilter and address each unique number of records. How can I do this?

I tried ListElementCounter and it returns everything.

 

In the CSV I am running, there are only 9 records between each 'G' feature. But it could fluctuate between 8 and 12 in other CSV files that I run.

I need this UID to perform joins on data after I define each attribute based on the Letter in col0. Each letter record has a unique number of fields. Is there a better way to do this?

Thanks!

You don't need to know how many lines there are between each feature as the features are processed in order. If the first feature has a value, then the second feature gets that value if you are looking at one previous feature. When it comes to the third feature, the second feature now has a value so again, only a need to look at the previous feature. The fourth feature can then look for the value in the third feature and so on


You don't need to know how many lines there are between each feature as the features are processed in order. If the first feature has a value, then the second feature gets that value if you are looking at one previous feature. When it comes to the third feature, the second feature now has a value so again, only a need to look at the previous feature. The fourth feature can then look for the value in the third feature and so on

@egomm I'm not tracking here. Do you have an example?

Here is my attribute manager and the Conditional Statement to create the "_UID_others" field:

This set-up returns this:

 

How do I set the value of "_UID_Others" for Rows 3-10 "14_162127" and set the value of "_UID_others" for Rows 13-20 to "24_162133", etc.?

The only way i could do it was by setting the 'Number of Prior Features" to '9' like this:

Which gives me the result seen up above in the adjacentvalues-example3.png screenshot I posted earlier.

Is there something wrong with my conditional statement?

Thanks.

 


@mmccart

 

You can also use a variable retriever after testing for value "G" followed by a variableretriever.


@egomm I'm not tracking here. Do you have an example?

Here is my attribute manager and the Conditional Statement to create the "_UID_others" field:

This set-up returns this:

 

How do I set the value of "_UID_Others" for Rows 3-10 "14_162127" and set the value of "_UID_others" for Rows 13-20 to "24_162133", etc.?

The only way i could do it was by setting the 'Number of Prior Features" to '9' like this:

Which gives me the result seen up above in the adjacentvalues-example3.png screenshot I posted earlier.

Is there something wrong with my conditional statement?

Thanks.

 

adjacent_attribute_population.fmwt

Example with some mocked up data


@mmccart

 

You can also use a variable retriever after testing for value "G" followed by a variableretriever.

@gio I tried the VariableSetter and VariableRetriever and no luck. If you had an example, that would be appreciated.

Thanks.


adjacent_attribute_population.fmwt

Example with some mocked up data

Thanks @egomm! That worked!


Reply