...
新建数据源,类型选择自定义,取数选择列表,字段设置origin_id 和名称,基于排序码做排序,是否分页为是,过来条件是日期和部门和名称,基于排序码做排序,是否分页为是,过滤条件是日期和部门
注意:如果你的项目用到了多级排序
元数据参数如下:
关联设置如下:
信息 |
---|
|
{ "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 }, { "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 }] }, "name": "组织", "class": "list", "sorts": [{ "key": "orderno", "type": "asc", "label": "排序码" }], "source": { "meta": { "model": "DepartmentHistory", "relations": [], "conditions": { "enabled": 1, "end_date": { "gt": "=date_" }, "org_type": { "neq": 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 } |
...
公式二:emp_count 是人员分析表,两个模型基于dept_ 和 origin_id 关联
这里的”count”是人数的字段名,不是计数的意思
人员总数:[VLOOKSTAT(emp_count,'dept_:eq:{origin_id}','sum','count',default='0')] 这里只需要将部门作为关联条件
...
35岁以下:[VLOOKSTAT(emp_count,'dept_:eq:{origin_id};employee_age_count:lte:35','sum','count',default='0')] 通过lte 获取年龄小于35的人员
公式三:合计公式公式三:合计公式,意思是汇总 B5这个指定单元格和(0,-1)这个动态单元格的和
[RANGE_SUM('B5',(0,-1))]
...