Output from "parse(att1)" not numerical?

New Altair Community Member
Updated by Jocelyn
Hi,
I'm trying to create a process that shows for every customer/article combination the month of the first purchase
Select Customer, Article, Min(Month)
Group By Customer, Article
The Month consists actually of two attributes, year and month (i. g. "2013-01"). It seems that RapidMiner can only calculate a minimum from numbers, not from text, so I generate a number via parse():
parse(concat(year,month), which correctly results in "201301".
In the next step, I use the "aggregate" operator, grouping by customer and article, aggregating the minimum of the parsed number. Running the process provides the correct results, and the meta view shows "real" as datatype. However, the aggregate operator shows that little yellow warning triangle with this message:
The value type of the attribute Year_Month_Numeric is not compatible with the aggregation function minimum. It requires an attribute of type numeric or date_time but is nominal.
Even worse, when I try to rename the MinMonth field, it does not even show up in the Rename operator.
To me this actually looks like a bug, but then I'm certainly a newbie and I'd hope that somebody can help me out.
Not sure if that helps, but this is the process code:
I'm trying to create a process that shows for every customer/article combination the month of the first purchase
Select Customer, Article, Min(Month)
Group By Customer, Article
The Month consists actually of two attributes, year and month (i. g. "2013-01"). It seems that RapidMiner can only calculate a minimum from numbers, not from text, so I generate a number via parse():
parse(concat(year,month), which correctly results in "201301".
In the next step, I use the "aggregate" operator, grouping by customer and article, aggregating the minimum of the parsed number. Running the process provides the correct results, and the meta view shows "real" as datatype. However, the aggregate operator shows that little yellow warning triangle with this message:
The value type of the attribute Year_Month_Numeric is not compatible with the aggregation function minimum. It requires an attribute of type numeric or date_time but is nominal.
Even worse, when I try to rename the MinMonth field, it does not even show up in the Rename operator.
To me this actually looks like a bug, but then I'm certainly a newbie and I'd hope that somebody can help me out.
Not sure if that helps, but this is the process code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>Any help would be greatly appreciated.
<process version="5.3.008">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.3.008" expanded="true" name="Process">
<parameter key="encoding" value="UTF-8"/>
<process expanded="true">
<operator activated="true" class="read_database" compatibility="5.3.008" expanded="true" height="60" name="Read Database" width="90" x="45" y="30">
<parameter key="connection" value="MyConnection"/>
<parameter key="define_query" value="table name"/>
<parameter key="table_name" value="30_00_00_Sales"/>
<enumeration key="parameters"/>
</operator>
<operator activated="true" class="generate_attributes" compatibility="5.3.008" expanded="true" height="76" name="Generate Attributes" width="90" x="112" y="210">
<list key="function_descriptions">
<parameter key="Year_Month_Numeric" value="parse(concat(Year,Month))"/>
</list>
<parameter key="use_standard_constants" value="false"/>
</operator>
<operator activated="true" class="aggregate" compatibility="5.3.008" expanded="true" height="76" name="Aggregate" width="90" x="313" y="210">
<list key="aggregation_attributes">
<parameter key="Year_Month_Numeric" value="minimum"/>
</list>
<parameter key="group_by_attributes" value="|Customer|Article"/>
</operator>
<operator activated="true" class="rename" compatibility="5.3.008" expanded="true" height="76" name="Rename" width="90" x="447" y="210">
<list key="rename_additional_attributes"/>
</operator>
<connect from_op="Read Database" from_port="output" to_op="Generate Attributes" to_port="example set input"/>
<connect from_op="Generate Attributes" from_port="example set output" to_op="Aggregate" to_port="example set input"/>
<connect from_op="Aggregate" from_port="example set output" to_op="Rename" to_port="example set input"/>
<connect from_op="Rename" 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>