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
"Error on joining data"
Hello all,
I am trying to join two different excel files, having a common ID column which can be used for joining. However, I keep receiving an error at runtime: "Process failed. duplicate attribute name: 1". The first row of each file contains the column names, the columns have different names (excepting the one used for joining). What's wrong?
Thanks in advance,
Lucian
I am trying to join two different excel files, having a common ID column which can be used for joining. However, I keep receiving an error at runtime: "Process failed. duplicate attribute name: 1". The first row of each file contains the column names, the columns have different names (excepting the one used for joining). What's wrong?
Thanks in advance,
Lucian
Tagged:
0
Answers
actually I can't reproduce the problem. See here for my simple example process: Could you please post your process setup, too?
Greetings,
Sebastian
In my case, the id columns used for joining the two data are present in both files and I don't generate them. The data
My code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.1.003">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.1.003" expanded="true" name="Process">
<process expanded="true" height="639" width="805">
<operator activated="true" class="read_excel" compatibility="5.1.003" expanded="true" height="60" name="Read Excel" width="90" x="45" y="75">
<parameter key="excel_file" value="D:\Work\lenses_part1.xls"/>
<parameter key="imported_cell_range" value="a2:d25"/>
<list key="annotations"/>
<list key="data_set_meta_data_information">
<parameter key="0" value="id.true.real.id"/>
<parameter key="1" value="col1.true.real.regular"/>
<parameter key="2" value="col2.true.real.regular"/>
<parameter key="3" value="col3.true.real.regular"/>
</list>
</operator>
<operator activated="true" class="read_excel" compatibility="5.1.003" expanded="true" height="60" name="Read Excel (2)" width="90" x="45" y="210">
<parameter key="excel_file" value="D:\Work\lenses_part2.xls"/>
<parameter key="imported_cell_range" value="A2:d25"/>
<list key="annotations"/>
<list key="data_set_meta_data_information">
<parameter key="0" value="id.true.numeric.id"/>
<parameter key="1" value="col4.true.numeric.regular"/>
<parameter key="2" value="col5.true.numeric.regular"/>
<parameter key="3" value="col6.true.numeric.regular"/>
</list>
</operator>
<operator activated="true" class="join" compatibility="5.1.003" expanded="true" height="76" name="Join" width="90" x="246" y="120"/>
<connect from_op="Read Excel" from_port="output" to_op="Join" to_port="left"/>
<connect from_op="Read Excel (2)" from_port="output" to_op="Join" to_port="right"/>
<connect from_op="Join" from_port="join" 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>
The data in lenses_partX.xls are obtained from http://archive.ics.uci.edu/ml/machine-learning-databases/lenses/lenses.data, the first 4 columns are retained in lenses_part1.xls, the others are in lenses_part2.xls and the id is manually inserted into the xls file.
Thanks,
Lucian
Change this
<parameter key="1" value="col4.true.numeric.regular"/>
<parameter key="2" value="col5.true.numeric.regular"/>
<parameter key="3" value="col6.true.numeric.regular"/>
to this
<parameter key="a" value="col4.true.numeric.regular"/>
<parameter key="b" value="col5.true.numeric.regular"/>
<parameter key="c" value="col6.true.numeric.regular"/>
I think it's because the attribute names are not set; the import wizard default is to use names lke 1,2,3.
regards
Andrew
"Error transforming meta data transformation: java.lang.NumberFormatException: For input string: "a" ".
Lucian
Try the attached. I think it's because the range was A2:d25 which meant it was using row 2 as the names of the attributes so it failed on the initial read of the Excel files (the names of the Excel files will need to be changed for the setup you have).
regards
Andrew
Thanks for your replies.
Lucian