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)


frantsch
Contributor
Forum|alt.badge.img+3

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.

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

5 replies

Forum|alt.badge.img+2

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

dialog


frantsch
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • 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+3
  • Author
  • Contributor
  • 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
  • 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+3
  • Author
  • Contributor
  • March 11, 2021

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

Regards,

Bernd


Reply


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