I have a table where I am trying to update its values based on a lookup table. I have tried some join logic and does not seem to work.. How will I be able to achieve this ?
Base Table:
State | City | Revenue | Profit |
NY | East | 100 | |
NY | West | 200 | |
CA | Central | 400 | |
CA | Mid | 200 |
Lookup Table
State | City | Profit_Lkp |
NY | East | 200 |
NY | West | 50 |
CA | Central | 75 |
Desired Output
State | City | Revenue | Profit |
NY | East | 100 | 200 |
NY | West | 200 | 50 |
CA | Central | 400 | 75 |
CA | Mid | 200 |
I have attached base workflow as well.
Solved! Go to Solution.
I was looking for how will I overwrite/update base table's column with value from lookup table.
as you already 7-meteor rank. I hope you can learn/explore first and only ask when you have no clue.
so, it was vlookup profit. to table 1. hence simple join will do, which you have did. but it left one. which not in table2.
hence, union tool is used to add back the data. (the CA mid).
now, you should have "profit" and "Profit_Lkp", just use select tool to remove "profit" and rename "Profit_Lkp" to "Profit".
if original have data in table 1 (i.e. CA - Mid's profit is 100), move the select tool earlier. (i left this to you, you can do it.)
hope you can learn something here.
Yes I was planning for that, but was curious if there are better methods.. Sometimes we have to ask and learn from the best.
User | Count |
---|---|
18 | |
14 | |
13 | |
9 | |
8 |