Skip to main content
Solved

How to use a string value contained in an attribute for the tester left value (in order to defining one of the other attribute to be tested)

  • March 9, 2021
  • 5 replies
  • 136 views

frantsch
Contributor
Forum|alt.badge.img+4

My Feature Type has several attributes (eg. a, b, c, and s). One of them (e.g. s) is special , it contains the name (string) of one of the other attributes.

Now I would like to test my features. I would like to use the string value content from this special attribute s (which for example is 'b') in order to define the left value attribute for my test, for example: @Value(b).

Any hints for that are very welcome! Many thanks!

Best answer by markatsafe

@frantsch​  OK I see. Thanks for the workspace. You can use either:

@Value($(s))

or

@Value(@Value(_s))

I've attached your workspace with the changes.

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.

5 replies

Forum|alt.badge.img+2
  • 1891 replies
  • March 9, 2021

@frantsch​ If I understand you correctly, you should be able to use AttributeCreator:

dialog


frantsch
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • 27 replies
  • March 10, 2021

This would create a new attribute named according to the string value contained in attribute s, to stick with the above example. Which is the name of one of the other existing attributes (a, b or c). So the newly created attribute would then be a copy of an existing attribute with the same name, right?

I am afraid this is not what I need. I only want to test one of the existing attributes (a, b, or c) against any criteria. The string value in attribute s only decides, which attribute a, b, or c is the one to be tested.


frantsch
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • 27 replies
  • March 10, 2021

I have created an example workspace 'parameterize_tested_attribute.fmw' to illustrate my problem.

The published parameter called s contains the name one of the three attributes a, b, or c as string value.

My question is:

How am I to set the Tester transformer left value, so that it will use the string value from the published parameter s (which is fetched into an additional attribute called _s) to test the corresponding attribute named a, b, or c against the criteria < 0.5.


Forum|alt.badge.img+2
  • 1891 replies
  • Best Answer
  • March 10, 2021

@frantsch​  OK I see. Thanks for the workspace. You can use either:

@Value($(s))

or

@Value(@Value(_s))

I've attached your workspace with the changes.


frantsch
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • 27 replies
  • March 11, 2021

In my case, it works perfect with @Value(@Value(_s))! Many thanks! This is something one should definitely know!

Regards,

Bernd