在计算中使用Data Studio日期范围的第一天和最后一天

问题描述 投票:0回答:1

示例表:

Date, CustomerID
2020-01-01,a
2020-01-01,b
2020-01-01,c
2020-01-02,a
[...]
2020-01-31,a
2020-01-31,b
2020-01-31,c
2020-01-31,d
2020-02-01,a
2020-02-01,b
[...]

假设我将日期范围设置为2020-01-01-2020-01-31。

Id要计算之间的差:

(count_distinct(CustomerId) with filter Date=2020-01-01) - (count_distinct(CustomerId) with filter Date=2020-01-31) and get the result 1. 

我已经尝试过MAX(Date)MIN(Date),但是我找不到将其用作过滤器的方法。

当连接到大查询时,我可以使用@DS_START_DATE,但我想在Data Studio中使用它。

这可能吗?谢谢。

google-data-studio
1个回答
0
投票

也许您可以通过创建三个公式字段来完成此操作?

© www.soinside.com 2019 - 2024. All rights reserved.