...
1. 报表平台中点击新增-新建报表
报表类别请选择分析报表、按要求填入必要的基本信息
2. 点击上传模版
将excel表样上传到系统中
点击过滤设置
点击过滤设置、添加报表过滤条件
数据源设置
制作前分析:
此报表规则:选择某个单位,展示这个单位的下一级单位或者部门里面的人员情况。
此报表规则:选择某个单位,展示这个单位的下一级单位或者部门里面的人员情况,我们需要至少2个数据源,两个数据源通过组织的origin_id相关联id相关联。
数据源一:展示某个单位下一级部门。
新建数据源,类型选择自定义,取数选择列表,字段设置origin_id 和名称,基于排序码做排序,是否分页为是,过滤条件是日期和部门
注意:一、如果你的项目用到了多级排序码,那么需要关联“DepartmentOrderNO”这个模型注意:如果你的项目用到了多级排序码,那么需要关联“DepartmentOrderNO”这个模型
元数据参数如下:
关联设置如下:
信息 | title | 元数据设置
---|
代码块 |
{ "key": "dept_list", "data":{ { "type": "list", "field": [{ { "key": "origin_id", "align": "right", "field": [ "origin_id"], ], "label": "ORIGIN_ID", "state": null, "width": 100, "format": null, "object": null, "is_blur": false, "sequence": 10, "data_type": "integer", "fieldFunc":null }, { null }, { "key": "name", "align": "left", "field": [ "name"], ], "label": "名称", "state": null, "width": 250, "format": null, "object": null, "is_blur": true, "sequence": 20, "data_type": "string", "fieldFunc":null }] }, null } ] }, "name": "组织", "class": "list", "sorts": [{ { "key": "orderno", "type": "asc", "label": "排序码" }], } ], "source":{ { "meta":{ { "model": "DepartmentHistory", "relations": [], "conditions":{ { "enabled":1, 1, "end_date":{ { "gt": "=date_" }, }, "org_type":{ { "neq":40 }, 40 }, "parent_id": "=depart_id", "begin_date":{ { "lte": "=date_" } }, } }, "relation_mode": null, "static_filters": [{ { "key": "date_", "label": "日期" }, { }, { "key": "depart_id", "label": "上级组织" }] }, } ] }, "type": "meta" }, "page_count": true, "filter_dict":{ { "date_": "=CURR_DATE", "depart_id": "=CURR_DEPARTMENT" }, "total_include": false } |
数据源二:基于此表需要的条件做分组。
注意点:一:基于人员做统计分析,主模型是注意点:1:基于人员做统计分析,主模型是JobInformation 内关联到:Employee,OrgPositionHistory,OrgDepartmentHistory,DepartmentHierarchy
二、系统的人员是在最末级部门,这里需要用的 组织层级 2、系统的人员是在最末级部门,这里需要用到组织层级 DepartmentHierarchy 这个模型
三、因为要关联最高学历,防止出现某个人无学历信息的情况,这里的关联类型要选 3、因为要关联最高学历,防止出现某个人无学历信息的情况,这里的关联类型要选外连接。(内连接外连接相当于数据库的inner join和left join的区别)
4、第二个数据源的分页一定要选否。
...
数据源关联配置:
代码块 | ||
---|---|---|
{
"key": "emp_count",
"data": {
"dim": [{
"dim": {
"field": "dept_level.l1_id"
},
"key": "dept_",
"align": "left",
"field": ["dept_level_l1_id_5", "name"],
"label": "二级部门",
"state": null,
"width": 160,
"format": null,
"object": "OrgDepartment",
"is_blur": false,
"sequence": 10,
"data_type": "integer",
"fieldFunc": null
}, {
"dim": {
"field": "employee_category_id"
},
"key": "category",
"align": "left",
"field": ["master_employee_category_id_b", "name"],
"label": "用工类型",
"state": null,
"width": 160,
"format": null,
"object": "EmployeeCategory",
"is_blur": false,
"sequence": 20,
"data_type": "integer",
"fieldFunc": null
}, {
"dim": {
"field": "employee.age_count"
},
"key": "employee_age_count",
"align": "right",
"field": ["employee_age_count"],
"label": "年龄",
"state": null,
"width": 100,
"format": null,
"object": null,
"is_blur": null,
"sequence": null,
"data_type": "integer",
"fieldFunc": null
}, {
"dim": {
"field": "edu.education"
},
"key": "edu_education",
"align": "left",
"field": ["edu_education"],
"label": "学历",
"refer": "common_basic_item_data.学历代码",
"state": null,
"width": 300,
"format": null,
"object": null,
"is_blur": false,
"sequence": 30,
"data_type": "string",
"fieldFunc": null
}, {
"dim": {
"field": "employee.gender"
},
"key": "employee_gender",
"align": "left",
"field": ["employee_gender"],
"label": "性别",
"refer": "common_basic_item_data.性别",
"state": null,
"width": 300,
"format": null,
"object": null,
"is_blur": false,
"sequence": null,
"data_type": "string",
"fieldFunc": null
}],
"aggr": [{
"key": "count",
"aggr": {
"ag": "count",
"field": "employee_id"
},
"align": "left",
"field": ["master_employee_id_dvli"],
"label": "员工",
"state": null,
"width": 160,
"format": null,
"object": "Employee",
"is_blur": true,
"sequence": 10,
"data_type": "integer",
"fieldFunc": null
}],
"type": "aggr"
},
"name": "全员用工类型",
"class": "list",
"source": {
"meta": {
"model": "JobInformation",
"relations": [{
"key": "employee",
"name": "人员基础信息",
"model": "Employee",
"filter": {
"employee.id": ":employee_id"
}
}, {
"key": "position",
"name": "岗位信息",
"type": "outer",
"model": "OrgPositionHistory",
"filter": {
"position.end_date": {
"gt": "=date_"
},
"position.origin_id": ":position_id",
"position.begin_date": {
"lte": "=date_"
}
}
}, {
"key": "department",
"name": "部门信息",
"type": "outer",
"model": "OrgDepartmentHistory",
"filter": {
"department.end_date": {
"gt": "=date_"
},
"department.origin_id": ":position.parent_id",
"department.begin_date": {
"lte": "=date_"
}
}
}, {
"key": "dept_level",
"name": "组织层级",
"type": "inner",
"model": "DepartmentHierarchy",
"filter": {
"dept_level.l0_id": "=depart_id",
"dept_level.end_date": {
"gt": "=date_"
},
"dept_level.begin_date": {
"lte": "=date_"
},
"dept_level.department_id": ":department.origin_id"
},
"field_context": {
"date_": "=date_",
"root_id": "=depart_id",
"is_relative_level": true
}
}, {
"key": "edu",
"name": "教育",
"type": "outer",
"model": "EmployeeEducation",
"filter": {
"edu.is_highest": "1",
"edu.employee_id": ":employee_id"
},
"field_context": {
"is_relative_level": false
}
}],
"conditions": {
"on_job": 1,
"end_date": {
"gt": "=date_"
},
"begin_date": {
"lte": "=date_"
},
"position_type": 1
},
"relation_mode": null,
"static_filters": [{
"key": "date_",
"label": "日期"
}, {
"key": "depart_id",
"label": "上级组织"
}]
},
"type": "meta"
},
"page_count": false,
"filter_dict": {
"date_": "=CURR_DATE",
"depart_id": "=CURR_DEPARTMENT"
},
"total_include": false
} | title | 元数据设置如下
配置excel公式
此模版用到了两个excel公式、还有很多其他公式我们后面会有详细介绍。
...
CELL:获取指定坐标的值,常用于分析报表里的计算,通过CELL获取部分单元格的值之后相加减。
RANGE_SUM:合计
常用报表的小技巧
一、单个报表设置默认显示行
报表->设计->高级设置->
configs:{
"paging_config":
...
找到模型最底层元数据,修改is_logic 属性为true
三、公式的计算顺序
相关地址:https://mingcloud.hcmcloud.com/#/flex_report?report=emp01