Skip to main content

Hello!

I have two tables:

Table 1:

NameBasevalueaaa0bbb0bbb5bbb11ccc0

 

Table 2:

NameValuebbb3bbb8bbb10ccc8

 

Now I want to get for each feature from table 2 the nearest smaller 'Basevalue' from table 1 compared to the 'Value' of table 2.

The Result should look like this:

NameValueResultValuebbb30bbb85bbb105ccc80

 

Any ideas how to do so?

Greetings

Stefan

Hi @ferorelatum, this screenshot illustrates a possible way to do that.


Hi @ferorelatum, this screenshot illustrates a possible way to do that.

Another thought. The ListElementFilter is a custom transformer from the FME Hub.

 


The Inline Querier is another option

select t1.Name, t1.Value, max(t1.Basevalue) as ResultValue from (select * 
    from "Sheet2" s2,
    "Sheet1" s1
    where s2."Value" >= s1."Basevalue" 
    and s2.Name = s1.Name) t1
    group by t1.Name, t1.Value

find_nearest_below.fmwt


@takashi @ebygomm thanks a lot! Both of your options works fine!


Reply