"generate attribute - problem with attribute name?"

alexk
alexk New Altair Community Member
edited November 5 in Community Q&A
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

  • haddock
    haddock New Altair Community Member
    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!



  • alexk
    alexk New Altair Community Member
    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