gpt4 book ai didi

excel - 获取 Excel 查询的最后刷新日期/时间

转载 作者:行者123 更新时间:2023-12-04 22:12:47 25 4
gpt4 key购买 nike

我构建了一个查询以将文件读入 Excel。

//Query - Read File:

let
Source = Csv.Document(File.Contents(...)),
...
#"Transformed file contents" = ...
in
#"Transformed file contents"
set properties of the query每 1 分钟刷新一次,它似乎正在工作。
为了让我们的用户(和我)相信刷新工作正常,我想捕获刷新的日期/时间 此查询的 .
我知道如何创建一个单独的查询来捕获该单独查询的日期/时间。但是,这个单独的查询可能会成功,但读取文件的查询可能会失败。
方法 1 - 不希望
//Query - Get Date/Time:

let #"Last Refresh Date" = DateTime.LocalNow()
使用这种方法, Query - Read File可能会失败, Query - Get Date/Time可以成功。
方法 2 - 所需
//Query - Read File2:

Let
Source = Csv.Document(File.Contents(...)),
...
#"Transformed file contents" = ...,
#"Last Refresh Date" = DateTime.LocalNow()
in
#"Transformed file contents"
查询 Query - Read File2有效,但我不知道如何访问 #"Last Refresh Date 的值在 Excel 工作表中。
我可以在 Query - Read File 中添加一列这是每个 https://stackoverflow.com/a/65777778/11262633 的当前日期/时间.我宁愿不承担重复数据的开销。
是否有其他方法可以将 Query - Read File 的刷新日期/时间带入 Excel 工作表?在上面的任何一个例子中?

最佳答案

以防万一评论消失,就像他们有时那样,我不雅的解决方案是
在单个现有或新列中添加带有日期的行作为最后一个查询步骤

FinalAppend = Table.Combine({#"PriorStepName",#table({"Column Name"}, {{DateTime.LocalNow()}})})

关于excel - 获取 Excel 查询的最后刷新日期/时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71717619/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com