[英]How can I show zeros count?
I am preparing a report with some data of places and the number of visits to these places by a list of staff.我正在准备一份报告,其中包含一些地方数据以及工作人员列表访问这些地方的次数。 That is, each person has to visit a number of places in the week.也就是说,每个人必须在一周内访问多个地方。 I need to show the list of people, the place and count the total visits in the week.我需要显示人员名单、地点并计算一周内的总访问量。
I have two databases, the first one contains the person in charge and the place.我有两个数据库,第一个包含负责人和地点。 And in the other one I have the history of visits where is the person, the week and the place.在另一个中,我有访问历史,其中包括人、周和地点。
However, I want to show the places that are still to be visited in a specific week.但是,我想显示在特定一周内仍有待访问的地方。 But as there is no data int the history database, Google Data Studio does not show anything, I need it to show me the place, week and zeros.但是由于历史数据库中没有数据,Google Data Studio 没有显示任何内容,我需要它来显示地点、周和零。
I tried to merge those two databases but I couldn't find solution.我试图合并这两个数据库,但找不到解决方案。 The week is numeric and the other are text.星期是数字,其他是文本。
Table 1: visits_history表 1:visits_history
Personal个人的 | Station车站 | Week星期 |
---|---|---|
Person1人1 | Portal Américas美洲门户 | 30 30 |
Person1人1 | Portal Américas美洲门户 | 30 30 |
Person1人1 | MOVIL 1 MOVIL 1 | 30 30 |
Person1人1 | MOVIL 1 MOVIL 1 | 30 30 |
Person1人1 | Portal Américas美洲门户 | 30 30 |
Person1人1 | Portal Américas美洲门户 | 30 30 |
Person1人1 | Portal Américas美洲门户 | 30 30 |
Person1人1 | Portal Américas美洲门户 | 30 30 |
Person1人1 | Portal Américas美洲门户 | 30 30 |
Person1人1 | Portal Américas美洲门户 | 30 30 |
Person1人1 | Portal Américas美洲门户 | 30 30 |
Person1人1 | Portal Américas美洲门户 | 30 30 |
Person1人1 | Portal Américas美洲门户 | 31 31 |
Person1人1 | Portal Américas美洲门户 | 31 31 |
Person1人1 | Portal Eldorado传送门埃尔多拉多 | 31 31 |
Person1人1 | Portal Américas美洲门户 | 31 31 |
Person1人1 | Portal Américas美洲门户 | 31 31 |
Person1人1 | Portal Américas美洲门户 | 31 31 |
Person1人1 | Portal Américas美洲门户 | 31 31 |
Person1人1 | Portal Américas美洲门户 | 31 31 |
Person1人1 | Portal Américas美洲门户 | 31 31 |
Person1人1 | Portal Américas美洲门户 | 31 31 |
Person1人1 | Portal Américas美洲门户 | 31 31 |
Person1人1 | Portal Américas美洲门户 | 31 31 |
Person1人1 | MOVIL 3 MOVIL 3 | 31 31 |
Person1人1 | MOVIL 3 MOVIL 3 | 31 31 |
Person1人1 | Banderas P. Central班德拉斯页中央 | 31 31 |
Person1人1 | Banderas P. Central班德拉斯页中央 | 31 31 |
Person1人1 | Banderas P. Central班德拉斯页中央 | 31 31 |
Person1人1 | Banderas P. Central班德拉斯页中央 | 31 31 |
Person1人1 | Portal Américas美洲门户 | 31 31 |
Person1人1 | Portal Américas美洲门户 | 31 31 |
Person1人1 | Portal Américas美洲门户 | 31 31 |
Person1人1 | Portal Américas美洲门户 | 31 31 |
Person1人1 | Portal Américas美洲门户 | 31 31 |
Person1人1 | Portal Américas美洲门户 | 31 31 |
Person1人1 | Portal Américas美洲门户 | 31 31 |
Table 2: visits_to_do_per_week表 2:visits_to_do_per_week
Supervisor导师 | Punto蓬托 |
---|---|
Person1人1 | Banderas P. Central班德拉斯页中央 |
Person1人1 | Centro Comercial Gran Plaza Soacha Centro Comercial Gran Plaza Soacha |
Person1人1 | Centro Comercial Hayuelos哈尤洛斯商业中心 |
Person1人1 | Centro Comercial Milenio Plaza Centro Comercial 千禧年广场 |
Person1人1 | Movil 1移动 1 |
Person1人1 | Movil 2移动2 |
Person1人1 | Movil 3移动3 |
Person1人1 | Portal Américas美洲门户 |
Person1人1 | Portal Sur门户网站 |
Person1人1 | Super Cade Bosa超级凯德博萨 |
Person1人1 | Zona Franca自由区 |
Expected Result:预期结果:
person人 | station_asigment车站分配 | visits in the week一周的访问量 |
---|---|---|
Person1人1 | Banderas P. Central班德拉斯页中央 | 1 1个 |
Person1人1 | Centro Comercial Gran Plaza Soacha Centro Comercial Gran Plaza Soacha | 0 0 |
Person1人1 | Centro Comercial Hayuelos哈尤洛斯商业中心 | 0 0 |
Person1人1 | Centro Comercial Milenio Plaza Centro Comercial 千禧年广场 | 0 0 |
Person1人1 | Movil 1移动 1 | 1 1个 |
Person1人1 | Movil 2移动2 | 1 1个 |
Person1人1 | Movil 3移动3 | 2 2个 |
Person1人1 | Portal Américas美洲门户 | 1 1个 |
Person1人1 | Portal Sur门户网站 | 2 2个 |
Person1人1 | Super Cade Bosa超级凯德博萨 | 3 3个 |
Assuming that visted
table be as:假设visted
表为:
week星期 | person人 | visited参观过 |
---|---|---|
35 35 | Alice爱丽丝 | Paris巴黎 |
35 35 | Bob鲍勃 | Paris巴黎 |
35 35 | Bob鲍勃 | New York纽约 |
36 36 | Alice爱丽丝 | Paris巴黎 |
and the task
table be: task
表是:
person人 | place地方 |
---|---|
Alice爱丽丝 | Paris巴黎 |
Alice爱丽丝 | Berlin柏林 |
Alice爱丽丝 | Amsterdam阿姆斯特丹 |
Bob鲍勃 | Paris巴黎 |
Bob鲍勃 | New York纽约 |
Bob鲍勃 | Chicago芝加哥 |
Claire克莱尔 | Los Angeles洛杉矶 |
Case 1情况1
I assume that each week the same places have to be visited.我假设每周都必须访问相同的地方。
In Data studio create in the visited
table a slider parameter week_select
to select a week.在 Data studio 的visited
表中创建一个 slider 参数week_select
到 select 一周。 Then create a field with然后创建一个字段
week - week_select
Create a filter on the table with that field equal zero.在该字段为零的表上创建一个过滤器。
Add a table chart with person
and place
and click twice on the blue plus button under Metric:添加一个带有person
和place
的表格图表,然后在 Metric 下的蓝色加号按钮上单击两次:
Then add a metric field visited
with the formula然后添加一个用公式visited
的度量字段
case when Record Count is null then 0 else 1 end
You end up with that你最终得到那个
Case 2 In the task
table there is also a week column.案例 2在task
表中也有一个星期列。
So for each week other places have to be visited.因此,每周都必须访问其他地方。 Then there is no need to add the parameter and the week formula and the filter of it.那么就不需要添加参数和周公式以及它的过滤器了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.