【发布时间】:2022-04-05 03:15:12
【问题描述】:
我正在准备一份报告,其中包含一些地点数据以及工作人员列表访问这些地点的次数。也就是说,每个人都必须在一周内访问多个地方。我需要显示人员列表、地点并计算一周的总访问量。
我有两个数据库,第一个包含负责人和地点。在另一个中,我有访问历史,访问的人在哪里,星期和地点。
但是,我想显示在特定一周内仍有待访问的地方。但由于历史数据库中没有数据,Google Data Studio 没有显示任何内容,我需要它来显示地点、星期和零。
我尝试合并这两个数据库,但找不到解决方案。星期是数字,其他是文本。
表 1:visits_history
| Personal | Station | Week |
|---|---|---|
| Person1 | Portal Américas | 30 |
| Person1 | Portal Américas | 30 |
| Person1 | MOVIL 1 | 30 |
| Person1 | MOVIL 1 | 30 |
| Person1 | Portal Américas | 30 |
| Person1 | Portal Américas | 30 |
| Person1 | Portal Américas | 30 |
| Person1 | Portal Américas | 30 |
| Person1 | Portal Américas | 30 |
| Person1 | Portal Américas | 30 |
| Person1 | Portal Américas | 30 |
| Person1 | Portal Américas | 30 |
| Person1 | Portal Américas | 31 |
| Person1 | Portal Américas | 31 |
| Person1 | Portal Eldorado | 31 |
| Person1 | Portal Américas | 31 |
| Person1 | Portal Américas | 31 |
| Person1 | Portal Américas | 31 |
| Person1 | Portal Américas | 31 |
| Person1 | Portal Américas | 31 |
| Person1 | Portal Américas | 31 |
| Person1 | Portal Américas | 31 |
| Person1 | Portal Américas | 31 |
| Person1 | Portal Américas | 31 |
| Person1 | MOVIL 3 | 31 |
| Person1 | MOVIL 3 | 31 |
| Person1 | Banderas P. Central | 31 |
| Person1 | Banderas P. Central | 31 |
| Person1 | Banderas P. Central | 31 |
| Person1 | Banderas P. Central | 31 |
| Person1 | Portal Américas | 31 |
| Person1 | Portal Américas | 31 |
| Person1 | Portal Américas | 31 |
| Person1 | Portal Américas | 31 |
| Person1 | Portal Américas | 31 |
| Person1 | Portal Américas | 31 |
| Person1 | Portal Américas | 31 |
表 2:visits_to_do_per_week
| Supervisor | Punto |
|---|---|
| Person1 | Banderas P. Central |
| Person1 | Centro Comercial Gran Plaza Soacha |
| Person1 | Centro Comercial Hayuelos |
| Person1 | Centro Comercial Milenio Plaza |
| Person1 | Movil 1 |
| Person1 | Movil 2 |
| Person1 | Movil 3 |
| Person1 | Portal Américas |
| Person1 | Portal Sur |
| Person1 | Super Cade Bosa |
| Person1 | Zona Franca |
预期结果:
| person | station_asigment | visits in the week |
|---|---|---|
| Person1 | Banderas P. Central | 1 |
| Person1 | Centro Comercial Gran Plaza Soacha | 0 |
| Person1 | Centro Comercial Hayuelos | 0 |
| Person1 | Centro Comercial Milenio Plaza | 0 |
| Person1 | Movil 1 | 1 |
| Person1 | Movil 2 | 1 |
| Person1 | Movil 3 | 2 |
| Person1 | Portal Américas | 1 |
| Person1 | Portal Sur | 2 |
| Person1 | Super Cade Bosa | 3 |
【问题讨论】: