Skip to main content
Solved

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

  • July 8, 2020
  • 6 replies
  • 404 views

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3700 replies
  • July 8, 2020

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
  • 28 replies
  • 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+59
  • Celebrity
  • 3700 replies
  • July 8, 2020

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
  • 28 replies
  • 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+20
  • Safer
  • 3719 replies
  • 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+20
  • Safer
  • 3719 replies
  • July 9, 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

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...