Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Conditional Query Merge

Hi, i would like to merge (not merge as new) table1 with a table2 according to a conditional rule applied to another column of table1 so if table1  1 a 2 a 3 a 4 b and table2 a 15 b 7 // if...
  • BA_Pete's avatar
    5 years ago

    Hi Anonymous ,

     

    There is a way to do this but it's fairly complex if you're not comfortable with M code, and would also require a significant amount of memory as it involves buffering one table to compare to the other.

     

    To your point: no, only conditionally merging some values will not give you any processing gains, as every single row needs to be evaluated regardless.

     

    On balance, I think just doing the full merge then doing a conditional Replace Values afterwards would be the most prudent method.

     

    Pete