PowerQuery - 文件夹查询导入新文件 [英] PowerQuery - Folder Query import new files

查看:28
本文介绍了PowerQuery - 文件夹查询导入新文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我创建了一个从文件夹导入 XML 的 PowerQuery 函数,当文件夹中有新文件时,如何在同一个 excel 文件中重用查询以仅包含来自这些新文件的数据并将数据附加到当前表?

If I have created a PowerQuery function that imports XML from a folder, how in the same excel file do I reuse the query when there are new files in the folder to only include data from those new files and append the data to the current table?

推荐答案

如果您使用 From File/From Folder 启动 Power Query 并浏览到您的文件夹,您将看到每个文件都表示为表中的行,包含 Date modified 等列.您可以使用修改日期的日期/时间过滤器过滤该列表,或者在必要时通过更复杂的方式过滤该列表(发布您的具体要求,我会尝试引导您朝着正确的方向前进).

If you start a Power Query using From File / From Folder and browse to your folder, you will see each file represented as a row in a table, with columns such as Date modified. You can filter that list using Date/Time filters on Date modified or by something more complicated if necessary (post your specific requirements and I'll try to steer you in the right direction).

一旦您将查询过滤为新文件",您就可以将 [Content] 列传递给您的函数.

Once you have filtered the query to just the "new files", you can pass the [Content] column into your Function.

最后,根据您预先存在的查询中保存的 Excel 表输出以及上面的新文件"查询,附加一个新查询,以获得您的组合输出.新查询将设置为 Load To/Only Create Connection.

Finally Append a new query based on the saved Excel Table output from your pre-existing query together with the "new files" query above to get your combined output. The new query would be set to Load To / Only Create Connection.

这篇关于PowerQuery - 文件夹查询导入新文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆