Forum Discussion
Append queries (Automation)
- 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
Hi
Sales Apr file ->Have the original columns( say 10 columns) + 1 new concatenated column. Delete the dupicated columns as they are not required in the data model. So, total 11 columns
Sale May file -> This has the original columns (10) only
If you append both now, all 10 columns data will be appended and FOr the 11th column you will see data for Apr & null for May month.
Hope this clarifies you.
Thanks
Raj