英文:
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函数:
我应该如何在表格中实现这个函数?期望的行为是,一旦我在“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:
That, when called returns the revenue as number:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论