Google Apps脚本 - 使用查询组合2张,但无法完成

发布于 2025-01-18 00:15:53 字数 882 浏览 2 评论 0原文

我想知道使用查询功能合并工作表时是否存在行数限制,如何解决?

背景

我有 2 张包含数据的工作表:Sheet1 和 Sheet2。在 Sheet1 中,我有大约 13k 行,其中包含日期和 ID: Sheet1

在 Sheet2 中,我有大约 4.5k 行,我从 C 列中的时间戳中提取日期,以使日期值与 Sheet1 对齐:

Sheet2< /a>

目的

我想将 Sheet1 和 Sheet2 合并到 Sheet3 中,使用 unique 来同时删除具有相同 ID 和相同日期的那些行。

问题

目前在 Sheet3 中我使用以下公式:

在此处输入图像描述

并且 Sheet2 中的日期不知何故没有显示。但是,当我消除 Sheet1 中的大部分行,例如仅保留 10 行时,Sheet3 中的错误似乎已相应修复。

有人可以帮忙吗?谢谢!

I wonder if there's a limitation of number of rows when use query function to combine sheets, and how can we fix it?

Background

I have 2 sheets that contain data, Sheet1 and Sheet2. In Sheet1, I have around 13k rows with Date and ID:
Sheet1

In Sheet2 I have around 4.5k rows and I extract the date from timestamp in column C to make the date value align with Sheet1:

Sheet2

Purpose

I would like to combine Sheet1 and Sheet2 in Sheet3, using unique to deduplicate those rows with the same ID and same Date at the same time.

Question

Currently in Sheet3 I use this formula:

enter image description here

and the dates in Sheet2 somehow don't show up. But when I eliminate most of rows in Sheet1 and, for example, only retain 10 rows, the error in Sheet3 seems to be fixed accordingly.

Can someone help with this? Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

弥枳 2025-01-25 00:15:54

尝试:

=ARRAYFORMULA(QUERY(SPLIT(QUERY(UNIQUE(
 {Sheet1!A:A&"×"&Sheet1!B:B; Sheet2!A2:A&"×"&Sheet2!B2:B}), 
 "where Col1 is not null"), "×"), "order by Col2"))

演示电子表格

在此处输入图像描述

try:

=ARRAYFORMULA(QUERY(SPLIT(QUERY(UNIQUE(
 {Sheet1!A:A&"×"&Sheet1!B:B; Sheet2!A2:A&"×"&Sheet2!B2:B}), 
 "where Col1 is not null"), "×"), "order by Col2"))

demo spreadsheet

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文