Can you help me to compare fields in two tables? I have two tables, which contain ID and Measure fields. I need to take stroke by stroke values from field1(table1) and find all values in field1(table2) which are less than sought-for value. And then take largest of them and put it on stroke field2(table1). Example showed on picture below.
OK, so you basically need to compare each of the records in table 2 against each record in table 1. To me that suggests you are going to need a loop of some sort. You could either use a loop (or nested loops) inside a Custom Transformer, or you could do an alternative type of loop using a list.
For the list-type looping, check out my blog post on the subject.
Hope this helps. It's a tricky problem, but one that should be solvable with a little work.
I am a bit confused by your image. It looks like you're trying to join two tables. But your resulting table appears to have incorrect values in Field 2.
I'm going to assume you're trying to join the two tables based on the
This is a fairly straightforward process in FME. You can use the FeatureMerger Transformer.
Connect Table 1 to the Requestor port and Table 2 to the Supplier port. In the FeatureMerger dialog, you'll select the attributes that you'll be joining on. In your case, this will be
As long as there is no geometry and it's just tables, your Merge Type will be Attributes Only.
If you are then trying to find the smallest of the two fields, you will use an Attribute Creator Transformer and set the value using the Conditional option. I've called my attribute "Smallest" in this example.
And your condition would look something like this: