Forum Discussion

gtamir's avatar
gtamir
Post Patron
8 years ago
Solved

Append queries (Automation)

Hi. I have a general question about appending tables and by that to automate procedures. I have Sales table from April. There are the useal columns + a column that I created by merging two columns. ...
  • v-yuta-msft's avatar
    v-yuta-msft
    8 years ago

    Hi gtamir,

     

    "is it possible to merge as new?"

    <-- Yes, change step Merged Columns with M code below:

    = Table.AddColumn(#"Changed Type", "Merged", each Text.Combine({Text.From([PharmacyCode], "zh-CN"), Text.From([CustomerCode], "zh-CN")}, "-"), type text)

    "It didn't merge the columns for the appended file."

    <-- "Append" operation will not automactically merge columns in the appended table. As a workaround, to achieve your requirement, you can append 'Sheet1' to 'Sales' firstly, then Merge columns PharmacyCode and CustomerCode as a new merged column.

     

    Hope it's helpful to you.

     

    Jimmy Tao