The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

"generate attribute - problem with attribute name?"

alexkalexk Member Posts: 3 Contributor I
edited May 2019 in Help
hi,

i try to use the generate attribute operator. in my example set i have the 5 attributes "Close", "High", "Low", "Open" and "Date".

when i use the attribute "Close" in my function expression, it is not recognized as an attribute. however, when i use one of the other attributes everything works fine. my workaround to this is to rename the attribute close to something else.

but i am wondering if "Close" is a reserved keyword? if yes, then what does it stand for? if no, then i think this should be fixed  ;).


alex

Answers

  • haddockhaddock Member Posts: 849 Maven
    Hi there,

    It is more likely to be something else wrong with your setup. I have a price database with OHLC fields; if I rename C as Close I can still make the average, like this...

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.1.001">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="5.1.001" expanded="true" name="Process">
        <process expanded="true" height="361" width="807">
          <operator activated="true" class="retrieve" compatibility="5.1.001" expanded="true" height="60" name="Retrieve (2)" width="90" x="39" y="13">
            <parameter key="repository_entry" value="//DB/DELL/Example Sets/Updates"/>
          </operator>
          <operator activated="true" class="rename" compatibility="5.1.001" expanded="true" height="76" name="Rename" width="90" x="193" y="12">
            <parameter key="old_name" value="C"/>
            <parameter key="new_name" value="Close"/>
            <list key="rename_additional_attributes"/>
          </operator>
          <operator activated="true" class="generate_attributes" compatibility="5.1.001" expanded="true" height="76" name="Generate Attributes" width="90" x="380" y="30">
            <list key="function_descriptions">
              <parameter key="Av" value="(Close+H+L+O)/4"/>
            </list>
          </operator>
          <connect from_op="Retrieve (2)" from_port="output" to_op="Rename" to_port="example set input"/>
          <connect from_op="Rename" from_port="example set output" to_op="Generate Attributes" to_port="example set input"/>
          <connect from_op="Generate Attributes" from_port="example set output" to_port="result 1"/>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="sink_result 1" spacing="0"/>
          <portSpacing port="sink_result 2" spacing="0"/>
        </process>
      </operator>
    </process>
    Hope that helps!



  • alexkalexk Member Posts: 3 Contributor I
    thank you for your answer haddock, you are right.

    when i export my data with write csv and then import it again, everything works fine with the generate attributes operator. now i still have no idea why this happened, but at least it's fixed  :).


    alex
Sign In or Register to comment.