PowerQuery

编程入门 行业动态 更新时间:2024-10-22 23:28:42
本文介绍了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

本文发布于:2023-10-30 19:24:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1543774.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:PowerQuery

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!