1

I am new in FME and have a table with 10 columns. Every column contains different values.

I want to create a new column, which contains a combination of the other columns and for every combination of the values, there is a specific name.

That means I want to create classes from the other values.

example

Here a short example. I have 4 columns. The new column is based on the combination of other columns. If a=12, b=1, c=41 and d=Alpha then the new Value = Object 1 and so on.

Which is the best transformer for my task?

  • Just to clear the confusion. By analysing the values in the first 4 colums you would like to get the value from column 5 as a result right? – MyGIS Sep 4 '18 at 22:28
-1

I would use the "Tester" in series for all to set all the conditions in a raw (a feature as we call it) followed by the "AttributeCreator" You can change the Pass Criteria for the Tester from "Or" to "And"

Tester Transformer

AttributeCreator Transformer

  • Thank you for your advice, I will test your way. But I could solve my problem with the "conditional value" of the attribute manager. – joe_gerner Sep 4 '18 at 8:02
3

The answer by @buddiebubba is a good way to go; but I'll post another method anyway.

Add a Deaggregator transformer and use your combination of attributes for the group-by setting. Set a List name:

enter image description here

Now add a Counter to create an ID number, plus a Deaggregator:

enter image description here

That basically gives you a unique ID for each set of values using a single transformer. It's just a number though, so if you want Object 1, Object 2, etc instead of 1, 2, 3, etc then you can use a StringConcatenator to add "Object " as a prefix to each value.

Then you don't need to do the FeatureMerging, or filter out unique combinations. Just be careful with the Aggregator/Deaggregator parameters to ensure you get the right attributes.

  • This solution is faster as well. – nielsgerrits Sep 5 '18 at 5:01
2

If i understand your question correctly: There are multiple ways to do this but one way is:

  • Sampler to get one feature of every combination. (Group by a,b,c,d.)
  • Counter to give every combination a unique number.
  • AttributeCreator to create the "new Value" attribute.
  • FeatureMerger to add the combinations to the data. (Requestor/Supplier a,b,c,d)

FME Desktop 2018.1 Workbench

FME Desktop 2018.1 Inspector

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.