English 中文(简体)
如何适当利用职能。 InvokeAfter tomur Power Query Process of my full query in Excel
原标题:How to properly use Function.InvokeAfter to delay Power Query Processing of my entire query in Excel

我试图拖延在Excel的一家电餐会大约运行25秒(Lets称它为Query2)。 这是允许另一个查询(Query 1)首先从外部来源提取数据。 表2仅提及内部表格数据,其完成速度比表1快得多,这意味着它占用了大部分数据更新。 结果是,我最后两次使用“Refresh All”收集所有数据。 这是罚款,但通过使用权库高级编辑可以解决。

我可以不使用VBA代码,为特定电子表格(维持xx)。

我的在线研究显示这一功能。 可以用AvokeAfter来做到这一点。

我知道,你需要把所有问答行动称为一种功能,但我会同yn。

在这里,我的《规则》发挥了作用,但不会拖延所期望的提问。 我认为,问题是处理“让我们”指挥的方法(不是顺序)。 我确信, s子在电文高级编辑中是一杯新脑。 请注意,我不关心案文的到来时间,我只是试图“some忙”来拖延提问。 我尝试将源线作为功能,但我会发现一个错误,不能将表格作为类型功能退回。

let
    GetTimeAsText = ()=> DateTime.ToText(DateTime.LocalNow()), 
    Output = GetTimeAsText() & " " & Function.InvokeAfter(GetTimeAsText, #duration(0,0,0,25)),
    Source = Excel.CurrentWorkbook(){[Name="ReviewHist"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Download Dt", type datetime}, {"LTCF", type text}, {"Other Monitored Settings", type text}}),
    #"Appended Query" = Table.Combine({#"Changed Type", ReviewPrep}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Appended Query",{{"Download Dt", type date}}),
    #"Removed Duplicates" = Table.Distinct(#"Changed Type1", {"Download Dt"}),
    #"Sorted Rows" = Table.Sort(#"Removed Duplicates",{{"Download Dt", Order.Descending}})
in
    #"Sorted Rows"
问题回答

勿庸置疑,为什么你需要先完,但请在Qery1至Qery2中增加一字,迫使Query2在Query1之前完成。 您实际上不必使用所参考的数据。

//Query2 code
let Source2=Query1,
Source=blah blah,
#nextstep=(Source,

很幸运的是,你的询问不会自动等待,直到有人问,因为这是违约行为。 以下是如何使用职能的实例。 Invoke after. 你的问询没有参数,因此你可以产生一个没有变数的职能。

let
    query = () =>
    let
        Source = Excel.CurrentWorkbook(){[Name="ReviewHist"]}[Content],
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Download Dt", type datetime}, {"LTCF", type text}, {"Other Monitored Settings", type text}}),
        #"Appended Query" = Table.Combine({#"Changed Type", ReviewPrep}),
        #"Changed Type1" = Table.TransformColumnTypes(#"Appended Query",{{"Download Dt", type date}}),
        #"Removed Duplicates" = Table.Distinct(#"Changed Type1", {"Download Dt"}),
        #"Sorted Rows" = Table.Sort(#"Removed Duplicates",{{"Download Dt", Order.Descending}})
    in
        #"Sorted Rows",
    delay = Function.InvokeAfter(query,#duration(0,0,0,25)) 
in
    delay




相关问题
import of excel in SQL imports NULL lines

I have a stored procedure that imports differently formatted workbooks into a database table, does work on them then drops the table. Here is the populating query. SELECT IDENTITY(INT,1,1) AS ID ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

Excel date to Unix timestamp

Does anyone know how to convert an Excel date to a correct Unix timestamp?

C# GemBox Excel Import Error

I am trying to import an excel file into a data table using GemBox and I keep getting this error: Invalid data value when extracting to DataTable at SourceRowIndex: 1, and SourceColumnIndex: 1. As ...

Importing from excel "applications" using SSIS

I am looking for any tips or resources on importing from excel into a SQL database, but specifically when the information is NOT in column and row format. I am currently doing some pre-development ...

热门标签