Skip to main content
Solved

How to formulate the names of existing attributes using values from another attribute?


fmelizard
Safer
Forum|alt.badge.img+18

In this scenario, the source data has some attributes with names following a common pattern. e.g. test (a), test (b), test (c), etc.

 

We want to use all of these attributes on the left side of some test clause (in TestFilter). Instead of manually selecting every attribute, is it possible to use a formula to represent test (a), test (b), test (c)? We do have an attribute "name", whose values are a, b, c, etc. Also, the right side of the test clause can be set with the same expression, for all of these attributes.

Any suggestions would be much appreciated!

Best answer by xiaomengatsafe

After some testing, I realized there is a GUI bug in play that caused some confusion. We can easily use Text Editor to formulate the attribute names as such: @Value(test (@Value(name)))

And using it on the Left Value of a test Clauses works. However the Test Conditions GUI shows this as invalid (red). But the workspace runs fine, and produces expected result. I'll report this as a bug, with our developers.

 

Attached is a sample workspace to demonstrate what was the scenario, and how the testFilter was set up to get the result. formulate-attributename-with-values.fmw
View original
Did this help you find an answer to your question?

5 replies

mygis
Supporter
Forum|alt.badge.img+13
  • Supporter
  • August 22, 2017

HI could you provide us with a real sample of data? 10 records would do. Thank you @FMELizard


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • August 22, 2017

If you want to test multiple attributes for the same expression, using an AttributeValidator may be the best way of performing the test


xiaomengatsafe
Safer
Forum|alt.badge.img+3
mygis wrote:

HI could you provide us with a real sample of data? 10 records would do. Thank you @FMELizard

I don't actually have the real data. I'll mock something up.

 

 


Forum|alt.badge.img

Hi @FMELizard :)

please take a look at the attached workspace: it won't eliminate 'selecting each attribute' completely, but will help avoiding retyping the same condition/expression again and again.

There are two scenarios in the workspace:

  • _a > 10 AND _b > 10 AND _c > 10 AND _d > 10 AND _e > 10

and

  • _a > 10 OR _b > 10 OR _c > 10 OR _d > 10 OR _e > 10

We might be able to construct more complex conditions.


xiaomengatsafe
Safer
Forum|alt.badge.img+3

After some testing, I realized there is a GUI bug in play that caused some confusion. We can easily use Text Editor to formulate the attribute names as such: @Value(test (@Value(name)))

And using it on the Left Value of a test Clauses works. However the Test Conditions GUI shows this as invalid (red). But the workspace runs fine, and produces expected result. I'll report this as a bug, with our developers.

 

Attached is a sample workspace to demonstrate what was the scenario, and how the testFilter was set up to get the result. formulate-attributename-with-values.fmw

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