在这里,针对“ReportStudio入门教程(五十二) - 目标值(按层级取数)”,这张报表,讲下FM建模的方法
我们继续使用上一次的FM
1. 新建目标值表 dm_deptserquality_assess
季度ID,行政组织ID,目标值
对于目标值,每个层级的部门都有单独的目标值
drop table if exists dm_deptserquality_assess;
create table dm_deptserquality_assess(
quarter_id bigint,
dept_dmid bigint,
service_check_score numeric(28,4)
);
插入一些数据:
with tm_a as (
select distinct quarter_id from dm_calendar where year_id in (2012,2013) order by quarter_id
),
tm_b as (
select distinct dept_dmid from dm_dept_o