简体   繁体   English

如何显示零计数?

[英]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个

Editable Data Set (Google Sheets) 可编辑数据集(Google 表格)

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.在该字段为零的表上创建一个过滤器。

Blend the datasets:混合数据集: 在此处输入图像描述

Add a table chart with person and place and click twice on the blue plus button under Metric:添加一个带有personplace的表格图表,然后在 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.案例 2task表中也有一个星期列。

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.

相关问题 如何在 recyclerview 上显示 slider? - How can i show the slider on recyclerview? 如何更改 AlloyDB 中的自动备份保留计数? - How can I change for automated-backup retention count in AlloyDB? 如何计算 swift 中 firestore 查询的文档数? - How can I count the documents from a firestore query in swift? 如何在我的 lambda 上设置 sqs 的重试次数? - How can I set the retry count on sqs on my lambda? 我如何使用 pyspark 显示 hive 表 - How can i show hive table using pyspark 对于不存在结果的 GROUP BY 维度的组合,我怎样才能仅以“0”作为计数返回这些结果? - For combinations of GROUP BY dimensions where no results exist, how can I return those results anyway with just "0" as the count? 我如何向 flutter 中的有限用户显示图像 - How can i show images to limited users in flutter 我如何在一个列表中显示多个 collections - How can i show multiple collections in a single list 如何根据 BigQuery 中另一列的条件显示值的计数 - How to show a count of values based on condition of another column in BigQuery 如何根据堆积条形图中维度内的计数进行过滤? - How can I filter based on count within a dimension in a stacked bar chart?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM