Skip to main content
Solved

Can you get a list of attribute values in transformer (eg Tester)?


markcoopersdc
Contributor
Forum|alt.badge.img+6

Hi

I am trying to filter a dataset to show a features that are in set of values . I am using the Tester transformer with the IN operator. If I were to do this in an ESRI product, I could select the field (attribute) I want to filter and it would list all the unique values for that field to enable me to chose the ones I require. However, I cant see a way to get that info in FME - I have to stick in another transformer and inspector and then copy and paste the values I want into the expression, which is far from an ideal workflow.

Please could someone tell me if there is an easier way to do what I want to do? Many thanks

Best answer by fmelizard

Hi @markcoopersdc An enhancement to the Tester and TestFilter to see a list of values is actually on its way in the next few days. You're welcome to register for tomorrow's webinar to learn more.

View original
Did this help you find an answer to your question?

6 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

Unfortunately that's pretty much the way to do it.

To get a list of unique values for an attribute you can use a Sampler, set to group by that attribute, and only pass every 1st feature, or an InlineQuerier with a SELECT DISTINCT [attribute] FROM [feature type] query. Obviously that's only the unique values that are in the dataset now, since FME is mainly for building repeatable processes you don't know what's going to be in there in the future.


markcoopersdc
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • July 8, 2020

That's such a shame - I thought it was just me not knowing how to do it. In my opinion, its a massive, massive oversight of the developers part


redgeographics
Celebrity
Forum|alt.badge.img+49

Depending on what you want to do there may be other options. If you're going to be filtering on attributes that are present in the source data (instead of ones being created/altered during the course of your workspace) the AttributeFilter has an option to import existing values.


markcoopersdc
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • July 8, 2020

Unfortunately not in source data, but I guess I could write it out first.

Basically, I have used the attribute exploder and need to remove a lot of the attributes that have been exploded - I really don't want all the format attributes to be in there. I have removed the un-needed user attribute with an attribute manager before the exploder


fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • Best Answer
  • July 8, 2020

Hi @markcoopersdc An enhancement to the Tester and TestFilter to see a list of values is actually on its way in the next few days. You're welcome to register for tomorrow's webinar to learn more.


fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • July 9, 2020
markcoopersdc wrote:

That's such a shame - I thought it was just me not knowing how to do it. In my opinion, its a massive, massive oversight of the developers part

Hi Mark, As @danatsafe hinted, we're releasing the first step towards what you're asking in just a few hours. In fact, I'm just putting the finishing touches on the demo. The architecture of FME is such that, for the past 25+ years, the "design time" is different than the "run time" -- at design time, we didn't know the data's contents, just its structure (or schema). Only at run time does the data flow through. Lots of good benefits from this choice, but the big big downside is that you don't know what the values are when you're designing. And so you get the issue you hit (among others). Our "feature cache" mode of authoring, where we keep copies of the data at each step as you are designing, only recently came out and that is the springboard upon which capabilities like you're asking here can be built. Tomorrow we can't solve exactly your use case, but it was already on the near term roadmap prior to your question. Thanks for your patience while we get there...


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings