[英]Excel create multiple MS Queries using one data connection between two sheets in the same workbook
In Excel 2021, what exactly is a "data connection", "query" and "domain source name"?在 Excel 2021 中,“数据连接”、“查询”和“域源名称”究竟是什么?
Let's say I have a Workbook "Manahil_Customer_Database.xlsm" in which I have a sheet "sht_Customer_Cities" that has a table "tbl_Customer_Cities".假设我有一个工作簿“Manahil_Customer_Database.xlsm”,其中有一个表“sht_Customer_Cities”,其中有一个表“tbl_Customer_Cities”。 In a new sheet "sht_Report" I want to run two queries using one connection via MS Query.
在新工作表“sht_Report”中,我想通过 MS Query 使用一个连接运行两个查询。 Now when I go through the MS Query route I get one Domain Name Source File "Manahil_Customer_Database.dsn" and one MS Query file "Customer_Countries_Cities.dqy" and one Connection file "Customer_Countries_Cities.odc".
现在,当我通过 MS 查询路由 go 获得一个域名源文件“Manahil_Customer_Database.dsn”和一个 MS 查询文件“Customer_Countries_Cities.dqy”和一个连接文件“Customer_Countries_Cities.odc”。
However when I look at the "Queries & Connections" it says 0 Queries and 1 Connection named "Customer_Countries_Cities".但是,当我查看“查询和连接”时,它显示 0 个查询和 1 个名为“Customer_Countries_Cities”的连接。 I want to be able to establish a single Data Connection via MS Query from the "sht_Report" to the Workbook "Manahil_Customer_Database.xlsm" and than run multiple queries using the same connection.
我希望能够通过 MS Query 建立从“sht_Report”到工作簿“Manahil_Customer_Database.xlsm”的单个数据连接,然后使用同一连接运行多个查询。
If I understand the situation correctly, you are working internally , within a single excel file.如果我正确理解了情况,那么您正在内部工作,在单个excel文件中。 Data connections, queries, and domain sources, are all used to associate externally .
数据连接、查询和域源,都是用来对外关联的。
Internally I would think you could use a pivot-table and/or a slicer .在内部,我认为您可以使用数据透视表和/或切片器。
If you provide additional details on what specifically you are trying to do, a better answer could be provided.如果您提供有关您具体尝试做什么的更多详细信息,则可以提供更好的答案。
Some additional reading below may help further:下面的一些额外阅读可能会有所帮助:
Power Query replaced MS:Query from Excel 2016 onwards.从 Excel 2016 起,Power Query 取代了 MS:Query。 The objects and panes you are describing relate to Power Query, not MS:Query.
您描述的对象和窗格与 Power Query 相关,而不是 MS:Query。
Power Query is far more functional, reliable, flexible and performant than MS:Query. Power Query 比 MS:Query 更实用、更可靠、更灵活、更高效。
For example depending on your exact requirement, you might create a base query that gathers all the required data, then refer to that base query in Reference queries that filter the output needed for each destination table.例如,根据您的确切要求,您可以创建一个收集所有所需数据的基本查询,然后在过滤每个目标表所需的 output 的参考查询中参考该基本查询。
Here's a starting point for Power Query:这是 Power Query 的起点:
https://support.microsoft.com/en-us/office/about-power-query-in-excel-7104fbee-9e62-4cb9-a02e-5bfb1a6c536a https://support.microsoft.com/en-us/office/about-power-query-in-excel-7104fbee-9e62-4cb9-a02e-5bfb1a6c536a
Power Query is a MS tool that assists you on your ETL tasks. Power Query 是一种 MS 工具,可帮助您完成 ETL 任务。 As read in a previous answer, it is based on M language.
如上一个答案所述,它基于 M 语言。
To be able to import / modify / connect your data, the command is: DATA / GET DATA and select your input为了能够导入/修改/连接您的数据,命令是:DATA / GET DATA 和 select 您的输入
Check this link for a quick introduction: https://docs.microsoft.com/en-us/power-query/power-query-what-is-power-query查看此链接以获得快速介绍: https://docs.microsoft.com/en-us/power-query/power-query-what-is-power-query
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.