Please help to get the data from C5 column in ‘Table B’ sheet by joining the ‘Table A’ sheet with three common columns between two table.
Table A
|C1|C2|C3|C4|
|1|D1|A1|M4|
|4|D2|A2|M2|
|3|D3|A3|M1|
|4|D4|A4|M3|
|1|D5|A5|M5|
Table B
|C1|C2|C3|C5|
|1|D1|A1|10|
|4|D2|A2|20|
|1|D5|A5|30|
Expected Output
|C1|C2|C3|C4|C5|
|1|D1|A1|M4|10|
|4|D2|A2|M2|20|
|3|D3|A3|M1|0|
|4|D4|A4|M3|0|
|1|D5|A5|M5|30|
Note: C1, C2, C3, C4, C5 are column headers, could not upload sample data as UiPath is restricting for new users.
avejr748
(Ave Salvante Jr)
October 16, 2020, 2:15am
2
HI @vignesh.raja This is a bit complex to explain by words so I have attached a sample workflow using the data you provided and got your expected output. You can use the concept to adapt to your actual use case. test2.xaml (27.4 KB)
ppr
(Peter Preuss)
October 16, 2020, 8:40am
3
@vignesh.raja
for this task we can use Join Data Table activity with the join type left
left table is Table A
right side is Table
after joining we can set 0 for the missing matches in C5
finally we retrieve the from the join table the expected columns with
filter datatable and column filters
datatablevar.DefaultView.toTable(False, StringArrayWithColumnNamesToKeep)
@ppr Could you please help with .xaml file? Please use the Table A and B in excel sheets, could not attach due to UiPath restrictions.
ppr
(Peter Preuss)
October 16, 2020, 10:04am
6
@vignesh.raja
find starter help here
LeftJoin_3Cols_ResultWithMatch-1Col.xaml (12.7 KB)
it was implemented conservatively with using the eseential activities from UiPath. In some scenarios we would replace some implementation parts with using LINQ.
Refer to dtResult datatable.
Let us know your feedback