A tester only works at the feature level, so you can't look at data that isn't on the feature.
One approach (the simplest for me to explain and not a particularly efficient solution) is to read your CSV file in as a text file and make sure you're reading the whole file at once (so it comes on one feature)
Then pass this to a featuremerger as the supplier and pass your other data to the requestor port. In the feature merger set the join to '1=1'Coming out of the merged port, you should now have the same number of features coming in your requestor port with an additional attribute containing the entire csv.
Now you can pass this into the test with your original contains statement with the right value now being the attribute containing the csv file
A tester only works at the feature level, so you can't look at data that isn't on the feature.
One approach (the simplest for me to explain and not a particularly efficient solution) is to read your CSV file in as a text file and make sure you're reading the whole file at once (so it comes on one feature)
Then pass this to a featuremerger as the supplier and pass your other data to the requestor port. In the feature merger set the join to '1=1'Coming out of the merged port, you should now have the same number of features coming in your requestor port with an additional attribute containing the entire csv.
Now you can pass this into the test with your original contains statement with the right value now being the attribute containing the csv file
Thank you for the idea. Just to clarify, would this add the entire csv as an attribute column for each row?
Thank you for the idea. Just to clarify, would this add the entire csv as an attribute column for each row?
As its being read in as a text file (not as a csv) it treats each row as a new feature (doesn't split it into columns), then, because the reader is specified to read the whole file at once, it actually reads the complete CSV file into one attribute, on one feature. It's then treated as a text field
Thank you for the idea. Just to clarify, would this add the entire csv as an attribute column for each row?
Thanks again, it does seem strange to me there isn't a more efficient way to do something equivalent to 'if x in y: <action>'.
Thank you for the idea. Just to clarify, would this add the entire csv as an attribute column for each row?
In a way, that is exactly what youre doing (if x in y) FME works at a feature level, so that statement is true for the context of a feature, hence 'loading' the whole csv into one attribute
A more 'complex' and efficient approach is to use an inlinequerier which loads your input data into an SQLite database which then allows you to write a SQL statement to do 'database level' joins etc