电子表格 Libreoffice calc - 数据透视表 - 如何对至少间隔 30 分钟的时间块进行分组

发布于 2025-01-12 12:52:47 字数 2091 浏览 3 评论 0 原文

我在 libreoffice calc 中有一份报告,其中包含 2 张纸。 第一个是数据表,第二个是“报告”表(带有数据透视表)。

在第一个数据表中,有 3 个重要的列,第一列有日期,第二列有时间戳,第三列有称为“类型”的产品代码。

我正在尝试创建一个数据透视表,它会自动显示每个日期、每个“时间块”(至少间隔 30 分钟)、每种类型的类型计数。

麻烦在于如何创造时间块。两个时间戳之间至少需要有 30 分钟的时间才能被视为一段时间。

例如,数据表:

日期 时间 类型
17.01.22 9:13 12
17.01.22 9:14 12
17.01.22 9:15 17
17.01.22 9:20 17
17.01.22 9:22 17
17.01.22 12:28 17 号
17.01.22 12:42 17
17.01.22 15:16 17
17.01.22 15:42 17
17.01.22 15:55 13
17.01.22 15:58 13

The end result in a pivot table should be:
日期 时间帧 类型 计数类型
17.01.22 9:13- 9:22 12 2
17.01.22 9:13-9:22 17 3
17.01.22 12:28-12:42 17 2
17.01.22 15:16-15 :58 17 2
17.01.22 15:16-15:58 13 2

日期 时间帧 类型 计数类型
17.01.22 9:13-9:22 12 2
17 3
17.01.22 12:28-12:42 17 2
17.01.22 15:16-15:58 17 2
13 2

如果您有任何问题,请告诉我。 并提前感谢您。

I have a report in libreoffice calc which contains 2 sheets.
The first one is a data sheet and the second one is a "report" sheet (with pivot tables).

In the first data sheet, there are 3 important columns, the first column has dates, the second column has time stamps and the third column has a product code called "Type".

I'm trying to create a pivot table that would automatically show per date, per "chuncks of time" seperated by a minimum of 30 mins, the count of type per type.

The trouble comes from how to create the chunks of time. There needs to be at least a 30 mins between 2 time stamp to qualify as a chunck of time.

for example, Data sheet:

Date Time Type
17.01.22 9:13 12
17.01.22 9:14 12
17.01.22 9:15 17
17.01.22 9:20 17
17.01.22 9:22 17
17.01.22 12:28 17
17.01.22 12:42 17
17.01.22 15:16 17
17.01.22 15:42 17
17.01.22 15:55 13
17.01.22 15:58 13

The end result in a pivot table should be:

Date Time-Frame Type Count-Type
17.01.22 9:13-9:22 12 2
17.01.22 9:13-9:22 17 3
17.01.22 12:28-12:42 17 2
17.01.22 15:16-15:58 17 2
17.01.22 15:16-15:58 13 2

or

Date Time-Frame Type Count-Type
17.01.22 9:13-9:22 12 2
17 3
17.01.22 12:28-12:42 17 2
17.01.22 15:16-15:58 17 2
13 2

Let me know if you have any question.
And thank you in advance.

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

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

发布评论

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

评论(1

迷离° 2025-01-19 12:52:48

最后我走了这条路:
https://ask.libreoffice.org/t/how-to-group-chuckks-of-time-seperated-by-a-minimum-of-30-mins-pivot-table/74936

它使用此论坛创建了一个帮助列:
in C2:=IF((N(A2)+N(B2)-N(A1)-N(B1))>(1/48);N(C1)+1;N(C1)

那么最终结果是:

日期 时间 类型
17.01.22 9:13 1
17.01.22 9:14 1
17.01.22 9:15 1
17.01.22 9:20 1
17.01.22 9:22 1
17.01.22 12:28 2
17.01.22 12:42 2
17.01.22 15:16 3
17.01.22 15:42 3
17.01.22 15:55 3
17.01.22 15:58 3

At the end I went this route:
https://ask.libreoffice.org/t/how-to-group-chuncks-of-time-seperated-by-a-minimum-of-30-mins-pivot-table/74936

Which creates a helper column with this forumla:
in C2:=IF((N(A2)+N(B2)-N(A1)-N(B1))>(1/48);N(C1)+1;N(C1)

Then end result is:

Date Time Type
17.01.22 9:13 1
17.01.22 9:14 1
17.01.22 9:15 1
17.01.22 9:20 1
17.01.22 9:22 1
17.01.22 12:28 2
17.01.22 12:42 2
17.01.22 15:16 3
17.01.22 15:42 3
17.01.22 15:55 3
17.01.22 15:58 3
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文