Forum Discussion
Anonymous
7 years agoNot applicable
Join 2 rows from tables
Hi, i have 2 tables, both has DATAAREAID and JOURNALID. I want to join these 2 rows, how can i do that? Have i to create a compound key? There are other ways? Thanks
- 7 years ago
yes, you will have to create a compound key by creating new columns that combine the fields you want to join on.
You could potentially create a seperate lookup table with all the distinct values and corresponding index fields but it's probably only worth it if you have lots of records and/or your compound fields are very long
selimovd
7 years agoMost Valuable Professional
If the 2 tables have exaclty the same columns and you just want to append the two tables, then use the "Append queries" function in Power Query.
Otherwise you should combine the two columns to a new column, maybe seperated by a underscore, and then do the join with this column. Take also a look at surrogate keys in this case.
Let me know if one of those things help