简体   繁体   English

Excel 使用同一工作簿中两个工作表之间的一个数据连接创建多个 MS 查询

[英]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 file.如果我正确理解了情况,那么您正在内部工作,在单个文件中。 Data connections, queries, and domain sources, are all used to associate externally .数据连接、查询和域源,都是用来对外关联的。

Internally I would think you could use a and/or a .在内部,我认为您可以使用和/或

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.

相关问题 使用 python 循环在一个 excel 工作簿中创建多个 excel 工作表,从一个 Z6A8064B5DF4794555500553C7 - Using python loop to create multiple excel sheets in one excel workbook from one dataframe 2 在同一个 Excel 工作簿不同的工作表上访问查询 - 2 Access queries on same Excel WorkBook different Sheets 将同一工作簿中的多个 Excel 工作表合成为一张工作表 - Compounding multiple Excel sheets in the same workbook into one sheet 如何创建一个包含多个工作表的Excel工作簿,其中每个工作表都是一个数据框 - How to create one excel workbook with multiple sheets in it where each sheet is a data frame 使用查询创建具有多个工作表的工作簿 - Create workbook with multiple sheets from Queries 使用 pandas 从同一工作簿中的多个 excel 工作表中提取部分数据 - Extract Partial Data from multiple excel sheets in the same workbook using pandas 将多个工作簿中的多个工作表合并到一个具有相同工作表的工作簿中,但是将合并多个工作表中的数据 - Consolidate multiple sheets in multiple workbooks into one workbook with the same sheets but the data in the multiple sheets will be consolidated 比较同一工作簿中的两个不同的Excel工作表 - Comparing two different Excel sheets in same workbook 比较一个 excel 工作簿中的两张纸? - Compare two sheets in one excel workbook? 如何在两张Excel工作簿之间将数据从一列复制并粘贴到另一张……而不会覆盖目标列的内容。 - how to copy & paste the data from one column to another between two sheets of excel workbook…without overwriting the destination column content..?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM