Divide a column values with a column in another table.

Teja_Varanasi
Teja_Varanasi New Altair Community Member
edited November 5 in Community Q&A
I have a Table with these columns

A  B  C  D
2  3   4  3
4  6   8  6
6  9   2  3
8  3   6  9

I have another table with same column names

A  B  C  D
2  3   2   3

I want to get the result 
A  B  C  D
1  1   2  1
2  2   4  2
3  3   1  1
4  1   3  3

can anyone suggest what should i do here

Best Answer

  • Mahmoud
    Mahmoud
    Altair Employee
    Answer ✓
    Hi Teja,  I was able to do this in Rapidminer Studio v10.  I used two Read CSV Operators for reading data.  Then I used two Generate Attribute Operators and added an id field wit value of one (1).  Then I added an Inner Join Operator and joined Id from both tables.  Finally I added a Generate Attribute Operator and divide data in one column with another column.  Please see screenshots below:
    Regards
    Mo









Answers

  • Caperez
    Caperez Altair Community Member
    Hi @Teja_Varanasi,
    one option is using the loop attributes operator combined with the extract Macro operator. 
    The idea is to use the extract Macro operator to extract the value of the second example set and then use it to operate over the first exampleset. 

    please find attached a simple approximation example. 


    Best
  • Teja_Varanasi
    Teja_Varanasi New Altair Community Member
    Hi, @ceaperez i got the same thought. I am getting error, when I do. And I was unable to open your file.
  • Caperez
    Caperez Altair Community Member
    Hi @Teja_Varanasi
    I attached the same process in XML format. 

    Best
  • Teja_Varanasi
    Teja_Varanasi New Altair Community Member
    ok thanks.. will do
  • Mahmoud
    Mahmoud
    Altair Employee
    Hi Teja,  I am new to Rapidminer, however, this can easily be done in Altair Monarch Dataprep studio software, the join table can be exported to a CSV file, the CSV file can be utilized by Rapidminer.
    Regards
    Mo
  • Mahmoud
    Mahmoud
    Altair Employee
    Answer ✓
    Hi Teja,  I was able to do this in Rapidminer Studio v10.  I used two Read CSV Operators for reading data.  Then I used two Generate Attribute Operators and added an id field wit value of one (1).  Then I added an Inner Join Operator and joined Id from both tables.  Finally I added a Generate Attribute Operator and divide data in one column with another column.  Please see screenshots below:
    Regards
    Mo