Filtering Question

evgeny
evgeny New Altair Community Member
edited November 5 in Community Q&A
Hi

is there a way to set up a filter (e.g. attribute_value_filter in ExampleFilter) such that the attributes are filtered relative to a variable as opposed to a fixed value?

thx

Answers

  • land
    land New Altair Community Member
    Hi,
    yes. I think that should to the Attribute_filter, isn't it?

    Greetings,
      Sebastian
  • evgeny
    evgeny New Altair Community Member
    thx, Sebastian, could you post an example?

    i know how to filter, say for attribute1 to be greater than zero (e.g. att1>0), but how can i filter for attribute1 to be greater than a variable (e.g. att1>x) where i would specify x externally. or ultimately get ParameterOptimisation to choose it for me.
  • haddock
    haddock New Altair Community Member
    G'Day,

    Variables are called Macros in RM, and can be incorporated most places that text gets accepted, like in SQL or parameters, in the format  %{Macro_name} , like this...
    <operator name="Root" class="Process" expanded="yes">
        <operator name="ExampleSetGenerator" class="ExampleSetGenerator">
            <parameter key="target_function" value="random"/>
        </operator>
        <operator name="Set Your Variable X" class="SingleMacroDefinition">
            <parameter key="macro" value="X"/>
            <parameter key="value" value="0.5"/>
        </operator>
        <operator name="ExampleFilter" class="ExampleFilter">
            <parameter key="condition_class" value="attribute_value_filter"/>
            <parameter key="parameter_string" value="att1&lt;%{X}"/>
        </operator>
    </operator>
  • evgeny
    evgeny New Altair Community Member
    thank you very much. very helpful as always.

    is there anywhere a list of acceptable synthax options for parameter_string (such as "att1<%{X}")?