Skip to main content

Hi,

i read a postgis table with the feature reader. As a WHERE clause i want to filter on a certain criteria, say:

 

name_community IN ('Comm1','Comm2','Comm3')

 

I would like to allow multiple selection. Therfore I have choosen the type of parameter "choice" and a list with multiple selection. The name of the parameter is "_community".

 

Now , I thought:

 

name_community IN (%(_community))

 

However, this does not work. Any support would be appreciated.

It seems you're missing a dollar-sign to indicate the reference the parameter. Try something like

name_community IN ($(_community))

 


I did not test this but does it work when you create the where statement in an attribute with an attributecreator upstream of the featurereader and then refer to the attribute in the featurereader?


I did not test this but does it work when you create the where statement in an attribute with an attributecreator upstream of the featurereader and then refer to the attribute in the featurereader?

Agreed. Definitely what I'd do myself in this situation. So much easier to debug and control for edge cases.


The query needs to have the correct syntax, so you need to generate a variable (_community_list) with a content of 'Comm1','Comm2','Comm3', and then use name_community in (@Value(_community_list)) in your query.

This can be done with an AttributeCreator and an Aggregator between two FeatureReader's.

Cheers


Hi everybody,

 

thanks realy a lot for the imediate and valuable replies! They helped me a lot.

I finally managed it, maybe not in the smartest way, but it works:

imageBest wishes, Uwe

 


Reply