Excel Power Query API调用,将结果返回到当前表格,并预先指定列。

huangapple go评论90阅读模式
英文:

Excel Power Query API Call, result returned to the current table with pre-specified column

问题

我正在使用Proff API来在Excel中获取公司的收入。目前,我正在尝试在Power Query中使其工作,但我也可以考虑使用VBA。

表格设置如下,组织编号(Org)作为查询的输入,结果应该输出在“Revenue”列中。

Org Revenue
914742315 x
960514718 x

我已经成功创建了一个可以从API中获取收入的Power Query函数:
Excel Power Query API调用,将结果返回到当前表格,并预先指定列。

当调用该函数时,它会返回数字形式的收入:
Excel Power Query API调用,将结果返回到当前表格,并预先指定列。

结果:
Excel Power Query API调用,将结果返回到当前表格,并预先指定列。

我应该如何在表格中实现这个函数?期望的行为是,一旦我在“Org”列中输入组织编号,函数就会自动获取收入并填充到“Revenue”列中。

英文:

I am working with the Proff API to fetch the revenue of companies in Excel. Currently I am trying to make it work with Power Query, but I am open to VBA too.

The table is set up as such with the organization number (Org) as an input for the query, and the result should be outputted in the column "Revenue".

Org Revenue
914742315 x
960514718 x

I have managed to create a working Power Query function that fetches the revenue from the API:
Excel Power Query API调用,将结果返回到当前表格,并预先指定列。

That, when called returns the revenue as number:
Excel Power Query API调用,将结果返回到当前表格,并预先指定列。

The result:
Excel Power Query API调用,将结果返回到当前表格,并预先指定列。

How can I implement this function in the table? The desired behavior should be that as soon as I type an organization number in the "Org" column, the function would fetch the revenue automatically in the "Revenue" column.

答案1

得分: 0

=在Org列中假设你的组织,你的函数名为get_revenue,添加列...自定义列...

=get_revenue([Org])

确保你的函数实际上使用了org变量来进行某种筛选。乍一看,我甚至看不到它被引用。

英文:

Assuming your org is in column Org and your function is named get_revenue, Add column ... custom column...

 =get_revenue([Org])

Make sure your function actually uses the org variable to filter something. First glance I don't even see that being referenced

huangapple
  • 本文由 发表于 2023年7月20日 16:24:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/76727972.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定