[SOLVED] Creating attribute with unkonwn value

FilipeFilipe Member Posts: 2 Contributor I
edited November 2018 in Help
Would appreciate any help on how to set value to unkown when creating a new attribute. I'm using the "Generate Attribute" operator a the function expression is something like:
if(contains(Q4, "Text#1"), 1, if(contains(Q4, "Text#2"), 2, if(contains(Q4, "Do not know"), ???, "")))



  • Options
    haddockhaddock Member Posts: 849 Maven
    Hi there Filipe,


    There's a good run through on this at ..


    and here's an example for you - basically you declare what a missing value looks like, and the operator converts it to RM internal format.
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.2.003">
      <operator activated="true" class="process" compatibility="5.2.003" expanded="true" name="Process">
        <process expanded="true" height="421" width="547">
          <operator activated="true" class="generate_nominal_data" compatibility="5.2.003" expanded="true" height="60" name="Generate Nominal Data" width="90" x="92" y="101"/>
          <operator activated="true" class="declare_missing_value" compatibility="5.2.003" expanded="true" height="76" name="Declare Missing Value" width="90" x="246" y="75">
            <parameter key="mode" value="nominal"/>
            <parameter key="nominal_value" value="value1"/>
          <operator activated="true" class="filter_examples" compatibility="5.2.003" expanded="true" height="76" name="Filter Examples" width="90" x="419" y="94">
            <parameter key="condition_class" value="no_missing_attributes"/>
          <connect from_op="Generate Nominal Data" from_port="output" to_op="Declare Missing Value" to_port="example set input"/>
          <connect from_op="Declare Missing Value" from_port="example set output" to_op="Filter Examples" to_port="example set input"/>
          <connect from_op="Filter Examples" 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"/>

  • Options
    FilipeFilipe Member Posts: 2 Contributor I
    Thx haddock, it solved my problem!
    Cheers, Filipe
Sign In or Register to comment.