数据模型更新
为了增加男女维度信息,首先我们需要在数据模型中加入男女信息,因此我们重新编辑一下部门员工数据模型。
1. 关联 ![](https://qcloudimg.tencent-cloud.cn/image/document/30a5c69ab220c0928eae7a8b291f6ad1.png)
n此处关联位置很重要,因为只有
employees
表。n员工性别是通过 employess
表的 gender
字段承载的,因此我们拖拽 employees
表到数据模型可视化区域中。n![](https://qcloudimg.tencent-cloud.cn/image/document/30a5c69ab220c0928eae7a8b291f6ad1.png)
dept_emp
表才有 emp_no
字段,所以我们将 employees
表与 dept_emp
表进行关联。2. 选择关联关系,选择员工号 ![](https://qcloudimg.tencent-cloud.cn/image/document/545fdabb0ba68897d18af17c1bacf974.png)
n单击确定以后,关联 ![](https://qcloudimg.tencent-cloud.cn/image/document/122586d95a4599c72de12d77fb4fca02.png)
emp_no
作为关联字段。n![](https://qcloudimg.tencent-cloud.cn/image/document/545fdabb0ba68897d18af17c1bacf974.png)
employees
表以后的数据如下:n![](https://qcloudimg.tencent-cloud.cn/image/document/122586d95a4599c72de12d77fb4fca02.png)
注意
gender
字段信息, 其中 F
代表女性, M
代表男性。工作簿编辑
在这里,我们需要利用到一个特性 ![](https://qcloudimg.tencent-cloud.cn/image/document/6e8ce035394a181e217fd01256623cd4.png)
n最终效果如下:n![](https://qcloudimg.tencent-cloud.cn/image/document/0eba434599cccbcb75c8608910cfbd57.png)
n对比数据,我们会发现,此时每个部门都是根据男女进行分类统计。
break轴
。n所谓 break轴
,即将原始维度的信息再次进行拆分,拆分的条件则是 break 轴字段内容。n因此,此处我们将 gender
字段拖拽到 break轴
里:n![](https://qcloudimg.tencent-cloud.cn/image/document/6e8ce035394a181e217fd01256623cd4.png)
![](https://qcloudimg.tencent-cloud.cn/image/document/0eba434599cccbcb75c8608910cfbd57.png)
总结
到目前为止,我们已经完成了一个统计部门员工数据,并且根据性别进行拆分。