"Using Generate Attribute after Windowing Operator Error"

User: "habibalex"
New Altair Community Member
Updated by Jocelyn
I have to use the rename attribute operator after the windowing operator to successfully use the generate attribute operator.  This is because the windowing operator uses dashes ('-') instead of underscores ('_') when creating new attributes.

For example:
I have a dataset w/ a column name 'Close'
=> Windowing Operator, window size = 2. 
new data set has column names 'Close-0', 'Close-1'
When I use generate operator 'Close-0*2', I get an error: 'Unrecognized Symbol Close'

However if I rename the operator to 'Close_0' and then use generate operator w/ 'Close_0*2' it is fine.  Please update the windowing operator to account for this bug!




    <operator activated="true" class="series:windowing" compatibility="5.1.002" expanded="true" height="76" name="Windowing" width="90" x="179" y="30">
        <parameter key="horizon" value="1"/>
        <parameter key="window_size" value="2"/>
        <parameter key="create_single_attributes" value="false"/>
        <parameter key="create_label" value="true"/>
        <parameter key="label_attribute" value="Close"/>
      </operator>
<operator activated="true" class="rename" compatibility="5.1.006" expanded="true" height="76" name="Rename" width="90" x="284" y="155">
        <parameter key="old_name" value="Close-0"/>
        <parameter key="new_name" value="Close_0"/>
        <list key="rename_additional_attributes"/>
      </operator>
      <operator activated="true" class="generate_attributes" compatibility="5.1.006" expanded="true" height="76" name="Generate Attributes" width="90" x="313" y="30">
        <list key="function_descriptions">
          <parameter key="result" value="if(Close_0&gt;label,1,if(Close_0&lt;label,-1,0))"/>
        </list>
      </operator>