"[SOLVED] Join - Cannot map another string for binary attribute: already mapped s"
rowan_g
New Altair Community Member
Hi All,
I'm trying to use the Join operator to do a look up data from the left input against a table at the right input - a "vlookup" in Excel - sorry, my IT skills are shocking.
It works for the first few key attributes but then as soon as there are multiple values in the "left key attributes" it gives this bug "Cannot map another string for binary attribute: already mapped two strings"
Any ideas how to achieve this with different operators?
Thanks in advance.
Cheers,
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.3.008">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.3.008" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="read_excel" compatibility="5.3.008" expanded="true" height="60" name="Read Excel" width="90" x="45" y="120">
<parameter key="excel_file" value="\\Earth\rgobey\Oli\Desktop\Auspac Invoices\961.XLS"/>
<parameter key="imported_cell_range" value="A1:J3474"/>
<list key="annotations">
<parameter key="0" value="Name"/>
</list>
<parameter key="date_format" value="dd/mm/yyyy"/>
<list key="data_set_meta_data_information">
<parameter key="0" value="InvoiceNo.true.binominal.attribute"/>
<parameter key="1" value="InvoiceDate.true.date.attribute"/>
<parameter key="2" value="OrderNo.true.polynominal.attribute"/>
<parameter key="3" value="Client.true.binominal.attribute"/>
<parameter key="4" value="InvoiceType.true.binominal.attribute"/>
<parameter key="5" value="AccCode.true.binominal.attribute"/>
<parameter key="6" value="Parameter.true.polynominal.attribute"/>
<parameter key="7" value="Units.true.integer.attribute"/>
<parameter key="8" value="Rate.true.numeric.attribute"/>
<parameter key="9" value="Amount.true.numeric.attribute"/>
</list>
</operator>
<operator activated="true" class="read_excel" compatibility="5.3.008" expanded="true" height="60" name="Read Excel (2)" width="90" x="45" y="210">
<parameter key="excel_file" value="\\Earth\rgobey\Oli\Desktop\Auspac Invoices\Client Table.xlsx"/>
<parameter key="imported_cell_range" value="A2:F26"/>
<parameter key="first_row_as_names" value="false"/>
<list key="annotations">
<parameter key="0" value="Name"/>
</list>
<list key="data_set_meta_data_information">
<parameter key="0" value="Client.true.binominal.attribute"/>
<parameter key="1" value="Invoice To.true.binominal.attribute"/>
<parameter key="2" value="InvoiceType.true.binominal.attribute"/>
<parameter key="3" value="Invoice Type.true.binominal.attribute"/>
<parameter key="4" value="AccCode.true.binominal.attribute"/>
<parameter key="5" value="Charge Type.true.binominal.attribute"/>
</list>
</operator>
<operator activated="true" class="join" compatibility="5.3.008" expanded="true" height="76" name="Join" width="90" x="313" y="120">
<parameter key="use_id_attribute_as_key" value="false"/>
<list key="key_attributes">
<parameter key="Client" value="Client"/>
<parameter key="InvoiceType" value="InvoiceType"/>
<parameter key="AccCode" value="Charge Type"/>
</list>
</operator>
<operator activated="true" class="generate_attributes" compatibility="5.3.008" expanded="true" height="76" name="Generate Attributes" width="90" x="447" y="120">
<list key="function_descriptions">
<parameter key="Charge Item" value="if(length(Parameter)>1,concat(AccCode," (",Parameter,")"),AccCode)"/>
</list>
</operator>
<operator activated="true" class="write_excel" compatibility="5.3.008" expanded="true" height="76" name="Write Excel" width="90" x="715" y="120">
<parameter key="excel_file" value="\\Earth\rgobey\Oli\Desktop\Auspac Invoices\Auspac Data.xlsx"/>
<parameter key="file_format" value="xlsx"/>
<parameter key="date_format" value="dd/mm/yyyy"/>
</operator>
<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_op="Generate Attributes" to_port="example set input"/>
<connect from_op="Generate Attributes" from_port="example set output" to_op="Write Excel" to_port="input"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
</process>
</operator>
</process>
I'm trying to use the Join operator to do a look up data from the left input against a table at the right input - a "vlookup" in Excel - sorry, my IT skills are shocking.
It works for the first few key attributes but then as soon as there are multiple values in the "left key attributes" it gives this bug "Cannot map another string for binary attribute: already mapped two strings"
Any ideas how to achieve this with different operators?
Thanks in advance.
Cheers,
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.3.008">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.3.008" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="read_excel" compatibility="5.3.008" expanded="true" height="60" name="Read Excel" width="90" x="45" y="120">
<parameter key="excel_file" value="\\Earth\rgobey\Oli\Desktop\Auspac Invoices\961.XLS"/>
<parameter key="imported_cell_range" value="A1:J3474"/>
<list key="annotations">
<parameter key="0" value="Name"/>
</list>
<parameter key="date_format" value="dd/mm/yyyy"/>
<list key="data_set_meta_data_information">
<parameter key="0" value="InvoiceNo.true.binominal.attribute"/>
<parameter key="1" value="InvoiceDate.true.date.attribute"/>
<parameter key="2" value="OrderNo.true.polynominal.attribute"/>
<parameter key="3" value="Client.true.binominal.attribute"/>
<parameter key="4" value="InvoiceType.true.binominal.attribute"/>
<parameter key="5" value="AccCode.true.binominal.attribute"/>
<parameter key="6" value="Parameter.true.polynominal.attribute"/>
<parameter key="7" value="Units.true.integer.attribute"/>
<parameter key="8" value="Rate.true.numeric.attribute"/>
<parameter key="9" value="Amount.true.numeric.attribute"/>
</list>
</operator>
<operator activated="true" class="read_excel" compatibility="5.3.008" expanded="true" height="60" name="Read Excel (2)" width="90" x="45" y="210">
<parameter key="excel_file" value="\\Earth\rgobey\Oli\Desktop\Auspac Invoices\Client Table.xlsx"/>
<parameter key="imported_cell_range" value="A2:F26"/>
<parameter key="first_row_as_names" value="false"/>
<list key="annotations">
<parameter key="0" value="Name"/>
</list>
<list key="data_set_meta_data_information">
<parameter key="0" value="Client.true.binominal.attribute"/>
<parameter key="1" value="Invoice To.true.binominal.attribute"/>
<parameter key="2" value="InvoiceType.true.binominal.attribute"/>
<parameter key="3" value="Invoice Type.true.binominal.attribute"/>
<parameter key="4" value="AccCode.true.binominal.attribute"/>
<parameter key="5" value="Charge Type.true.binominal.attribute"/>
</list>
</operator>
<operator activated="true" class="join" compatibility="5.3.008" expanded="true" height="76" name="Join" width="90" x="313" y="120">
<parameter key="use_id_attribute_as_key" value="false"/>
<list key="key_attributes">
<parameter key="Client" value="Client"/>
<parameter key="InvoiceType" value="InvoiceType"/>
<parameter key="AccCode" value="Charge Type"/>
</list>
</operator>
<operator activated="true" class="generate_attributes" compatibility="5.3.008" expanded="true" height="76" name="Generate Attributes" width="90" x="447" y="120">
<list key="function_descriptions">
<parameter key="Charge Item" value="if(length(Parameter)>1,concat(AccCode," (",Parameter,")"),AccCode)"/>
</list>
</operator>
<operator activated="true" class="write_excel" compatibility="5.3.008" expanded="true" height="76" name="Write Excel" width="90" x="715" y="120">
<parameter key="excel_file" value="\\Earth\rgobey\Oli\Desktop\Auspac Invoices\Auspac Data.xlsx"/>
<parameter key="file_format" value="xlsx"/>
<parameter key="date_format" value="dd/mm/yyyy"/>
</operator>
<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_op="Generate Attributes" to_port="example set input"/>
<connect from_op="Generate Attributes" from_port="example set output" to_op="Write Excel" to_port="input"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
</process>
</operator>
</process>
0
Answers
-
Hi,
in your ReadExcel operator settings you have defined most attributes as "binominal". That means they can only contain two values: value1 or value2. If they are asked to add any other value the process will fail. To change that for attributes which will consist of more than 2 different strings, select your "ReadExcel" operator, click on the "Edit List" button for the "data set meta data information" parameter and change the type via the dropdown menu in the second to last column for each affected attribute from "binominal" to "polynominal".
Regards,
Marco0 -
Thanks for that. Solved.
The binomial values were not correct.
I was also trying to map too many columns to each other - I just did reoccurring Join operators in the end and it seems to be working....0