报表名称:前线销售人力表

报表名称:前线销售人力表
模型名称:epcissasemployeeanalyzenew
维度:统计时间 机构 渠道 年龄区间 学历 司龄区间 人员类别   新报表新增 : 保费区间 险种 客户规模 客户类型 个人赔付率区间
指标:月初在职人力 月末在职人力 新入司人力 离司人力 净增人力
模块:epcissas模块
刷新频度:月度刷新,
对应BA:龚平 潘强 621595

配置库脚本:

epcissasemployeeanalyzenew9558  EpcisSasGroupBefore  M  010300 6 2015-07-01 03:02:46  
epcissasemployeeanalyzenew9558  EpcisSasGroup  M  010300 6 2015-07-01 03:04:36  
epcissasemployeeanalyzenew9558  EpcisSasEmployeeLevelDim  M  010300 6 2015-07-01 03:06:06  
epcissasemployeeanalyzenew9558  EpcisSasEmployeeFact01  M  010300 6 2015-07-01 03:24:12

EpcisSasEmployeeDealMon 158735 2015-07-01 03:06:d 2015-07-01 03:09:19 10.31.32.11  OK 3 07-01

依赖关系
EpcisSasEmployeeFact01
EpcisSasEmployeeChange4,EpcisSasGroup

EpcisSasEmployeeLevelDim
EpcisSasGroup

EpcisSasEmployeeChange4依次依赖下面JOB

EpcisSasEmployeeChange3
EpcisSasEmployeeChange2
EpcisSasEmployeeChange1
EpcisSasGroupFact,EpcisAlarmDeptMapUp
EpcisSasEmployeeFact
EpcisSasEmployeeDealMon

select A.task_name, A.task_status, A.RUN_TIME, a.dep
  from etl_task_config a
 where a.task_name in (‘EpcisSasGroupBefore‘,
                       ‘EpcisSasGroup‘,
                       ‘EpcisSasEmployeeLevelDim‘,
                       ‘EpcisSasEmployeeFact01‘);

SELECT A.TASK_NAME,
       SUBSTR(A.PARAMETERS_LIST,
              INSTR(A.PARAMETERS_LIST, ‘IncStart=‘) + 9,
              8),
       A.RUN_LOG_DESC,
       A.START_TIME,
       A.END_TIME,
       A.ROW_NUM
  FROM ETL_TASK_RUN_LOG A --输出到结果表的数据是7752265
 WHERE A.TASK_NAME IN
       (‘EpcisSasGroupBefore‘,
                       ‘EpcisSasGroup‘,
                       ‘EpcisSasEmployeeLevelDim‘,
                       ‘EpcisSasEmployeeFact01‘)
      --and a.run_log_desc = ‘OK‘
   AND A.START_TIME > DATE ‘2015-04-01‘

--模型
select * from config_mdl a where a.mdl_name=‘epcissasemployeeanalyzenew‘

--fm取数对报表指标数据 EpcisSasemployeeOnJob
select T1."CALC_MONTH" as c1,
      (to_date(T1."CALC_MONTH",‘YYYYMM‘)) as c2,
      T1."EMPLOYEE_TYPE" as c3,
      T1."BIRTHDAY" as c4,
      T1."SEX" as c5,
      decode( T1."SEX", ‘M‘, ‘男‘, ‘女‘ ) as c6,
      T1."EDUCATION_CODE" as c7,
      T1."ENTER_DATE" as c8,
      T1."GROUP_CODE" as c9,
      T1."REGULAR_DATE" as c10,
      T1."LEAVE_DATE" as c11,
      T1."IS_AGENT" as c12,
      T1."DUTY_CODE" as c13,
      decode( T1."LEVEL_CODE", ‘000‘, ‘999‘, T1."LEVEL_CODE" ) as c14,
      T1."AGE_SEGMENT" as c15,
      T1."ENTER_COM_SEGMENT" as c16,
      T1."EMPLOYEE_CHANNEL" as c17,
      T1."CHANNEL_DUTY" as c18,
      DECODE(nvl(T1."VERSION_FLAG",‘0‘),‘N‘,‘已改革‘,‘0‘,‘未改革‘) as c19,
      T1."ON_JOB_MANPOWER" as c20,  --月末在职人力
      T1."NEW_NENTER_MANPOWER" as c21, --新入司人力
      T1."LEAVE_COM_MANPOWER" as c22 --离司人力
     from "POLAPDATA"."EPCIS_SAS_EMPLOYEE_FACT_01" T1

--涉及结果表
EPCIS_SAS_GROUP
EPCIS_SAS_EMPLOYEE_FACT_01
EPCIS_SAS_EMPLOYEE_LEVEL_DIM
BEGIN 
POLAPDATA_TRUNCATE_PROCEDURE(‘EPCIS_SAS_GROUP‘); 
POLAPDATA_TRUNCATE_PROCEDURE(‘EPCIS_SAS_EMPLOYEE_FACT_01‘);
POLAPDATA_TRUNCATE_PROCEDURE(‘EPCIS_SAS_EMPLOYEE_LEVEL_DIM‘);
END;

EpcisSasGroup job数sql
SELECT
GROUP_CODE, GROUP_NAME, GROUP_TYPE, GROUP_REMARK, DEPARTMENT_CODE, START_DATE, ABANDON_DATE, LAST_UPDATE_DATE, LAST_UPDATE_BY, CREATION_DATE, CREATION_BY, URBAN, GROUP_CHANNEL, SALE_TYPE
FROM
epcisbase.sas_group

EpcisSasEmployeeLevelDim job取数sql    --EPCIS_SAS_EMPLOYEE_LEVEL_DIM
select view_employee_level.code as level_code,
       view_employee_level.name as level_name,
       view_employee_level.is_manager
  from view_employee_level
 where view_employee_level.name not like ‘E76%‘
 
EpcisSasEmployeeFact01 job取数sql LEVEL_CODE 是主键 ---EPCIS_SAS_EMPLOYEE_FACT_01
SELECT EPCIS_SAS_EMPLOYEE_DEAL_MON.CALC_MONTH,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.EMPLOYEE_CODE,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.EMPLOYEE_NAME,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.EMPLOYEE_TYPE,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.BIRTHDAY,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.SEX,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.EDUCATION_CODE,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.ENTER_DATE,
       T.DEPARTMENT_CODE AS DEPARTMENT_CODE,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.GROUP_CODE,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.REGULAR_DATE,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.LEAVE_DATE,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.IS_AGENT,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.DUTY_CODE,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.LEVEL_FLAG,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.PRE_LEVEL_FLAG,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.YEAR_BEGIN_LEVEL_FLAG,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.LEVEL_CODE,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.PRE_LEVEL_CODE,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.YEAR_BEGIN_LEVEL_CODE,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.NEW_ENTER_FLAG,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.AGE,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.ENTER_COMPANY_MONTHS,
       to_char((SELECT B.SEGMENT_ID
                 FROM EPCIS_SAS_RANK_SEGMENT_DIM B
                WHERE EPCIS_SAS_EMPLOYEE_DEAL_MON.AGE >= B.SEGMENT_FROM
                  AND EPCIS_SAS_EMPLOYEE_DEAL_MON.AGE <= B.SEGMENT_TO
                  AND B.SEGMENT_FLAG = ‘1‘ --年龄区间
                  and rownum = 1)) AS AGE_SEGMENT,
       to_char((SELECT C.SEGMENT_ID
                 FROM EPCIS_SAS_RANK_SEGMENT_DIM C
                WHERE EPCIS_SAS_EMPLOYEE_DEAL_MON.Enter_Company_Months >=
                      C.SEGMENT_FROM
                  AND EPCIS_SAS_EMPLOYEE_DEAL_MON.Enter_Company_Months <=
                      C.SEGMENT_TO
                  AND C.SEGMENT_FLAG = ‘2‘ --司龄区间 
                  and rownum = 1)) AS ENTER_COM_SEGMENT,
       --在职人力
       to_char(CASE
                 WHEN EPCIS_SAS_EMPLOYEE_DEAL_MON.NEW_ENTER_FLAG IN (0, 1) /*AND
                      EPCIS_SAS_EMPLOYEE_DEAL_MON.LEVEL_FLAG IN (‘A‘, ‘V‘) AND
                      NVL(EPCIS_SAS_EMPLOYEE_DEAL_MON.IS_AGENT, ‘#‘) NOT IN
                      (‘L‘, ‘Y‘, ‘I‘)*/ THEN
                  1
                 ELSE
                  0
               END) AS ON_JOB_MANPOWER,
       --新入司人力
       to_char(CASE
                 WHEN EPCIS_SAS_EMPLOYEE_DEAL_MON.NEW_ENTER_FLAG = 1/* AND
                      EPCIS_SAS_EMPLOYEE_DEAL_MON.LEVEL_FLAG IN (‘A‘, ‘V‘) */THEN
                  1
                 ELSE
                  0
               END) AS NEW_NENTER_MANPOWER,
       --离司人力
       to_char(CASE
                 WHEN /*EPCIS_SAS_EMPLOYEE_DEAL_MON.LEVEL_FLAG IN (‘A‘, ‘V‘) AND*/
                      EPCIS_SAS_EMPLOYEE_DEAL_MON.NEW_ENTER_FLAG = 2 /*AND
                      EPCIS_SAS_EMPLOYEE_DEAL_MON.IS_AGENT = ‘L‘*/ THEN
                  1
                 ELSE
                  0
               END) AS LEAVE_COM_MANPOWER,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.CHANNEL_DUTY,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.VERSION_FLAG,
       EPCIS_SAS_EMPLOYEE_DEAL_MON.EMPLOYEE_CHANNEL,
      ‘0‘ as collect
  FROM EPCIS_SAS_EMPLOYEE_DEAL_MON, EPCIS_SAS_GROUP T
 WHERE EPCIS_SAS_EMPLOYEE_DEAL_MON.CALC_MONTH = SUBSTR(‘#IncStart#‘, 1, 6)
   AND EPCIS_SAS_EMPLOYEE_DEAL_MON.GROUP_CODE = T.GROUP_CODE
and EPCIS_SAS_EMPLOYEE_DEAL_MON.Hr_Code is not null

--EPCIS_SAS_EMPLOYEE_DEAL_MON 对应任务EpcisSasEmployeeDealMon

SELECT SUBSTR(‘#IncStart#‘, 1, 6) AS CALC_MONTH,
       EPCIS_SAS_EMPLOYEE.EMPLOYEE_CODE,
       EPCIS_SAS_EMPLOYEE.EMPLOYEE_NAME,
       EPCIS_SAS_EMPLOYEE.EMPLOYEE_TYPE,
       EPCIS_SAS_EMPLOYEE.BIRTHDAY,
       EPCIS_SAS_EMPLOYEE.SEX,
       EPCIS_SAS_EMPLOYEE.NATION_CODE,
       EPCIS_SAS_EMPLOYEE.EDUCATION_CODE,
       EPCIS_SAS_EMPLOYEE.MARRIAGE_CODE,
       EPCIS_SAS_EMPLOYEE.CERTIFICATE_TYPE,
       EPCIS_SAS_EMPLOYEE.CERTIFICATE_NO,
       EPCIS_SAS_EMPLOYEE.RESIDENCE,
       EPCIS_SAS_EMPLOYEE.GRANT_NAME,
       EPCIS_SAS_EMPLOYEE.GRANT_CERTIFICATE_TYPE,
       EPCIS_SAS_EMPLOYEE.GRANT_CERTIFICATE_NO,
       EPCIS_SAS_EMPLOYEE.ENTER_DATE,
       EPCIS_SAS_EMPLOYEE.DEPARTMENT_CODE,
      nvl( (SELECT GR.GROUP_CODE
          FROM EPCIS_SAS_EMP_GROUP_HISTORY GR
         WHERE GR.EMPLOYEE_CODE = EPCIS_SAS_EMPLOYEE.EMPLOYEE_CODE
           AND GR.START_DATE <= TO_DATE(‘#IncStart#‘, ‘YYYYMMDD‘)
           AND NVL(GR.END_DATE, TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘)) >=
               TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘) - 1
           AND ROWNUM = 1),(SELECT GR.GROUP_CODE
          FROM EPCIS_SAS_EMP_GROUP_HISTORY GR
         WHERE GR.EMPLOYEE_CODE = EPCIS_SAS_EMPLOYEE.EMPLOYEE_CODE
           AND GR.START_DATE >= TO_DATE(‘#IncStart#‘, ‘YYYYMMDD‘)
           AND   GR.START_DATE <=
               TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘) - 1
           AND NVL(GR.END_DATE, TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘)) >=
               TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘) - 1
           AND ROWNUM = 1)) AS GROUP_CODE,
       EPCIS_SAS_EMPLOYEE.EMPLOYEE_ENGLISH_NAME,
       EPCIS_SAS_EMPLOYEE.MAJOR_CODE,
       EPCIS_SAS_EMPLOYEE.TITLE_CODE,
       EPCIS_SAS_EMPLOYEE.HOBBY,
       EPCIS_SAS_EMPLOYEE.BLOOD_TYPE,
       EPCIS_SAS_EMPLOYEE.PARTY_TYPE,
       EPCIS_SAS_EMPLOYEE.HOME_ADDRESS,
       EPCIS_SAS_EMPLOYEE.ZIP_CODE,
       EPCIS_SAS_EMPLOYEE.TEL,
       EPCIS_SAS_EMPLOYEE.GRANT_ADDRESS,
       EPCIS_SAS_EMPLOYEE.REGULAR_DATE,
       EPCIS_SAS_EMPLOYEE.LEAVE_DATE,
       EPCIS_SAS_EMPLOYEE.EMPLOYEE_DOCUMENT,
       EPCIS_SAS_EMPLOYEE.REMARK,
       EPCIS_SAS_EMPLOYEE.PASSWORD,
       EPCIS_SAS_EMPLOYEE.PASSWORD_MARK,
       EPCIS_SAS_EMPLOYEE.ROW_ID,
       EPCIS_SAS_EMPLOYEE.LAST_UPDATE_DATE,
       EPCIS_SAS_EMPLOYEE.LAST_UPDATE_BY,
       EPCIS_SAS_EMPLOYEE.CREATION_DATE,
       EPCIS_SAS_EMPLOYEE.CREATION_BY,
       EPCIS_SAS_EMPLOYEE.SALARY_COUNT_TYPE,
       EPCIS_SAS_EMPLOYEE.AGENT_CODE,
       EPCIS_SAS_EMPLOYEE.IS_AGENT,
       EPCIS_SAS_EMPLOYEE.TYPE,
       EPCIS_SAS_EMPLOYEE.SUCCESSOR,
       EPCIS_SAS_EMPLOYEE.PCIS_DEPTCDE,
       EPCIS_SAS_EMPLOYEE.DUTY_CODE,
       EPCIS_SAS_EMPLOYEE.HR_CODE,
       EPCIS_SAS_EMPLOYEE.ISDUNNER,
       EPCIS_SAS_EMPLOYEE.PARTTIME_CROSSSALE_FLAG,
       EPCIS_SAS_EMPLOYEE.PARTTIME_CHANNEL_FLAG,
       EPCIS_SAS_EMPLOYEE.USE_FLAG,
       EPCIS_SAS_EMPLOYEE.LAST_GROUP_CODE,
       --当月职级类型
       NVL((SELECT A.FLAG
             FROM EPCIS_SAS_LEVEL_HISTORY A
            WHERE A.EMPLOYEE_CODE = EPCIS_SAS_EMPLOYEE.EMPLOYEE_CODE
              AND A.START_DATE <= TO_DATE(‘#IncStart#‘, ‘YYYYMMDD‘)
              AND NVL(A.END_DATE, TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘)) >=
                  TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘) - 1
              AND ROWNUM = 1),
           ‘99‘) AS LEVEL_FLAG,
       --上月职级类型
       NVL((SELECT A.FLAG
             FROM EPCIS_SAS_LEVEL_HISTORY A
            WHERE A.EMPLOYEE_CODE = EPCIS_SAS_EMPLOYEE.EMPLOYEE_CODE
              AND A.START_DATE <=
                  ADD_MONTHS(TO_DATE(‘#IncStart#‘, ‘YYYYMMDD‘), -1)
              AND NVL(A.END_DATE, TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘)) >=
                  ADD_MONTHS(TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘), -1) - 1
              AND ROWNUM = 1),
           ‘99‘) AS PRE_LEVEL_FLAG,
       --年初级别类型
       NVL((SELECT A.FLAG
             FROM EPCIS_SAS_LEVEL_HISTORY A
            WHERE A.EMPLOYEE_CODE = EPCIS_SAS_EMPLOYEE.EMPLOYEE_CODE
              AND A.START_DATE <=
                  TRUNC(TO_DATE(‘#IncStart#‘, ‘YYYYMMDD‘), ‘YY‘)
              AND NVL(A.END_DATE,
                      LAST_DAY(TRUNC(TO_DATE(‘#IncStart#‘, ‘YYYYMMDD‘), ‘YY‘))) >=
                  LAST_DAY(TRUNC(TO_DATE(‘#IncStart#‘, ‘YYYYMMDD‘), ‘YY‘))
              AND ROWNUM = 1),
           ‘99‘) AS YEAR_BEGIN_LEVEL_FLAG,
       --当月职级代码
       NVL((SELECT A.LEVEL_CODE
             FROM EPCIS_SAS_LEVEL_HISTORY A
            WHERE A.EMPLOYEE_CODE = EPCIS_SAS_EMPLOYEE.EMPLOYEE_CODE
              AND A.START_DATE <= TO_DATE(‘#IncStart#‘, ‘YYYYMMDD‘)
              AND NVL(A.END_DATE, TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘)) >=
                  TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘) - 1
              AND ROWNUM = 1),
           ‘999‘) AS LEVEL_CODE,
       --上月职级代码
       NVL((SELECT A.LEVEL_CODE
             FROM EPCIS_SAS_LEVEL_HISTORY A
            WHERE A.EMPLOYEE_CODE = EPCIS_SAS_EMPLOYEE.EMPLOYEE_CODE
              AND A.START_DATE <=
                  ADD_MONTHS(TO_DATE(‘#IncStart#‘, ‘YYYYMMDD‘), -1)
              AND NVL(A.END_DATE, TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘)) >=
                  ADD_MONTHS(TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘), -1) - 1
              AND ROWNUM = 1),
           ‘999‘) AS PRE_LEVEL_CODE,
       --年初级别代码
       NVL((SELECT A.LEVEL_CODE
             FROM EPCIS_SAS_LEVEL_HISTORY A
            WHERE A.EMPLOYEE_CODE = EPCIS_SAS_EMPLOYEE.EMPLOYEE_CODE
              AND A.START_DATE <=
                  TRUNC(TO_DATE(‘#IncStart#‘, ‘YYYYMMDD‘), ‘YY‘)
              AND NVL(A.END_DATE,
                      LAST_DAY(TRUNC(TO_DATE(‘#IncStart#‘, ‘YYYYMMDD‘), ‘YY‘))) >=
                  LAST_DAY(TRUNC(TO_DATE(‘#IncStart#‘, ‘YYYYMMDD‘), ‘YY‘))
              AND ROWNUM = 1),
           ‘999‘) AS YEAR_BEGIN_LEVEL_CODE,
       --入司标志 0--在职老员工,1--新员工,2-当月离职,3--当月之前离职,4-异常
       TO_CHAR(CASE
                 WHEN EPCIS_SAS_EMPLOYEE.ENTER_DATE <
                      TO_DATE(‘#IncStart#‘, ‘YYYYMMDD‘) AND
                      NVL(EPCIS_SAS_EMPLOYEE.LEAVE_DATE,
                          TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘)) >=
                      TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘) THEN
                  0
                 WHEN TO_CHAR(EPCIS_SAS_EMPLOYEE.ENTER_DATE, ‘YYYYMM‘) =
                      SUBSTR(‘#IncStart#‘, 1, 6) AND
                      NVL(EPCIS_SAS_EMPLOYEE.LEAVE_DATE,
                          TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘)) >=
                      TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘) THEN
                  1
                 WHEN TO_CHAR(EPCIS_SAS_EMPLOYEE.LEAVE_DATE, ‘YYYYMM‘) =
                      SUBSTR(‘#IncStart#‘, 1, 6) AND EPCIS_SAS_EMPLOYEE.ENTER_DATE <
                      TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘) THEN
                  2
                 WHEN EPCIS_SAS_EMPLOYEE.LEAVE_DATE <
                      TO_DATE(‘#IncStart#‘, ‘YYYYMMDD‘) AND
                      EPCIS_SAS_EMPLOYEE.ENTER_DATE <
                      TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘) THEN
                  3
                 ELSE
                  4
               END) AS NEW_ENTER_FLAG,
       TO_CHAR(TO_NUMBER(SUBSTR(‘#IncStart#‘, 1, 4)) -
               TO_NUMBER(TO_CHAR(EPCIS_SAS_EMPLOYEE.BIRTHDAY, ‘YYYY‘))) AS AGE,
       TO_CHAR((SUBSTR(‘#IncStart#‘, 1, 4) -
               TO_CHAR(EPCIS_SAS_EMPLOYEE.ENTER_DATE, ‘YYYY‘)) * 12 +
               (SUBSTR(‘#IncStart#‘, 5, 2) - TO_CHAR(ENTER_DATE, ‘MM‘))) AS ENTER_COMPANY_MONTHS,
       --当月人员渠道
       NVL((SELECT A.CHANNEL_TYPE
             FROM EPCIS_SAS_LEVEL_HISTORY A
            WHERE A.EMPLOYEE_CODE = EPCIS_SAS_EMPLOYEE.EMPLOYEE_CODE
              AND A.START_DATE <= TO_DATE(‘#IncStart#‘, ‘YYYYMMDD‘)
              AND NVL(A.END_DATE, TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘)) >=
                  TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘) - 1
              AND ROWNUM = 1),
           EPCIS_SAS_EMPLOYEE.EMPLOYEE_CHANNEL) AS EMPLOYEE_CHANNEL,
       --当月人员类别
       NVL((SELECT A.CHANNEL_DUTY
             FROM EPCIS_SAS_LEVEL_HISTORY A
            WHERE A.EMPLOYEE_CODE = EPCIS_SAS_EMPLOYEE.EMPLOYEE_CODE
              AND A.START_DATE <= TO_DATE(‘#IncStart#‘, ‘YYYYMMDD‘)
              AND NVL(A.END_DATE, TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘)) >=
                  TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘) - 1
              AND ROWNUM = 1),
           EPCIS_SAS_EMPLOYEE.CHANNEL_DUTY) AS CHANNEL_DUTY,
       --当月人员是否改革
       NVL((SELECT DECODE(NVL(A.CHANNEL_TYPE, ‘AA‘), ‘AA‘, ‘0‘, ‘N‘)
             FROM EPCIS_SAS_LEVEL_HISTORY A
            WHERE A.EMPLOYEE_CODE = EPCIS_SAS_EMPLOYEE.EMPLOYEE_CODE
              AND A.START_DATE <= TO_DATE(‘#IncStart#‘, ‘YYYYMMDD‘)
              AND NVL(A.END_DATE, TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘)) >=
                  TO_DATE(‘#IncEnd#‘, ‘YYYYMMDD‘) - 1
              AND ROWNUM = 1),
           EPCIS_SAS_EMPLOYEE.VERSION_FLAG) AS VERSION_FLAG,
           EPCIS_SAS_EMPLOYEE.PROPORTY_USE_FLAG,
           EPCIS_SAS_EMPLOYEE.ACCIDENT_USE_FLAG
/*EPCIS_SAS_EMPLOYEE.EMPLOYEE_CHANNEL,
       EPCIS_SAS_EMPLOYEE.CHANNEL_DUTY,
       EPCIS_SAS_EMPLOYEE.VERSION_FLAG*/
  FROM EPCIS_SAS_EMPLOYEE

EPCIS_SAS_EMPLOYEE --表的取数sql

SELECT EMPLOYEE_CODE,
       EMPLOYEE_NAME,
       EMPLOYEE_TYPE,
       BIRTHDAY,
       SEX,
       NATION_CODE,
       EDUCATION_CODE,
       MARRIAGE_CODE,
       CERTIFICATE_TYPE,
       CERTIFICATE_NO,
       RESIDENCE,
       GRANT_NAME,
       GRANT_CERTIFICATE_TYPE,
       GRANT_CERTIFICATE_NO,
       ENTER_DATE,
       DEPARTMENT_CODE,
       EMPLOYEE_ENGLISH_NAME,
       MAJOR_CODE,
       TITLE_CODE,
       HOBBY,
       BLOOD_TYPE,
       PARTY_TYPE,
       HOME_ADDRESS,
       ZIP_CODE,
       TEL,
       GRANT_ADDRESS,
       REGULAR_DATE,
       LEAVE_DATE,
       EMPLOYEE_DOCUMENT,
       REMARK,
       PASSWORD,
       PASSWORD_MARK,
       ROW_ID,
       LAST_UPDATE_DATE,
       LAST_UPDATE_BY,
       CREATION_DATE,
       CREATION_BY,
       SALARY_COUNT_TYPE,
       AGENT_CODE,
       IS_AGENT,
       TYPE,
       SUCCESSOR,
       PCIS_DEPTCDE,
       DUTY AS DUTY_CODE,
       HR_CODE,
       ISDUNNER,
       PARTTIME_CROSSSALE_FLAG,
       PARTTIME_CHANNEL_FLAG,
       USE_FLAG,
       LAST_GROUP_CODE,
       PROPORTY_USE_FLAG,
       ACCIDENT_USE_FLAG,
       UM_CODE,
       VERSION_FLAG,
       CHANNEL_DUTY,
       EMPLOYEE_CHANNEL,
       DUTY_TITLE_CODE
  FROM EPCISBASE.SAS_EMPLOYEE
 
 
 
--从头表取数核对报表上的数据,财产险应续
SELECT COUNT(DISTINCT CLIENT_NO) AS CLIENT_NO, --客户编码
       SUM(NVL(TO_NUMBER(T.PREMIUM), 0)) AS PREMIUM_RMB
  FROM PAS_RENEWAL_PAH T
 WHERE T.BATCH_NO >= SUBSTR(‘20150101‘, 1, 4)
   AND T.BATCH_NO < SUBSTR(‘20150601‘, 1, 6)
   AND T.PRODUCT_TYPE = ‘1‘ --财产险
   AND T.BUSINESS_TYPE = ‘2‘
   AND ORGAN_CODE = ‘202‘
-- AND TRIM(COST_RATE) IS NOT NULL

任务EpcisSasEmployeeFact01依赖层次  --从调度平台查询

--取数语句

--对此报表数据问题的统一回复

这个因为这个月数据延迟的原因,当清单为客户打优质标识的时候,我们MIS本月最新的变动成本率还没计算出来及时给到清单系统,也就是说清单这个月初为客户打优质标识的时候,用的还是MIS 5月份的变动成本率数据,所以导致这个客户在清单那边还是优质客户,下个月就不会是优质客户了
德芳,麻烦将这个数据延迟的事情通告给机构用户,让他们了解这个优质标识数据延迟的事情

是这样的,14年底如果客户已经不符合优质定义的话,那么14年全年的数都会不含这个客户的,同时14年作为历史数据,在15年不会再变化。

同理,15年所有数据,都会根据每月刷新而变动。

换言之,我们14年年底看MIS中14年的数和现在看14年的数是一样的?--是的

汪婷说的:
提取已续保清单是在几号提的?
因为对于意健险有一个问题就是:他总是发生批改,如果你在发生批改的那两天去提数据,是提取不到的。因为发生批改之后,我们从承保系统去到清单系统,
然后进行数据加工处理需要两条时间。

JOB 命令行脚本

cd C:\Program Files\Ascential\DataStage7.5.3

--开发到开发
(description=(address=(protocol=tcp)(host=epcis.dbcow.paic.com.cn)(port = 1560))(connect_data=(sid = epcis)))
cow_circtrep
"wW=G?3px2v"

dsjob -server 10.31.6.12 -user olapetl -password Paic1234 -run -jobstatus -warn 50 -param SourceDsn=d0pcrpt -param SourceUid=olapman -param SourcePwd=paic1234 -param TargetDsn=d0pcrpt -param TargetUid=olapman -param TargetPwd=paic1234 -param IncStart=20150501 -param IncEnd=20150601 -param ExtractType=M -param $APT_CONFIG_FILE=/wls/dsadm/Ascential/DataStage/Configurations/default.apt PacrptPacrptM EpcisSasPasDestAllAcc01

dsjob -server 10.31.6.12 -user olapetl -password Paic1234 -run -jobstatus -warn 50 -param SourceDsn=d0pcrpt -param SourceUid=olapman -param SourcePwd=paic1234 -param TargetDsn=d0pcrpt -param TargetUid=olapman -param TargetPwd=paic1234 -param IncStart=20150501 -param IncEnd=20150601 -param ExtractType=M -param $APT_CONFIG_FILE=/wls/dsadm/Ascential/DataStage/Configurations/default.apt PacrptPacrptM EpcisSasPasDestAllAcc02

dsjob -server 10.31.6.12 -user olapetl -password Paic1234 -run -jobstatus -warn 50 -param SourceDsn=d0pcrpt -param SourceUid=olapman -param SourcePwd=paic1234 -param TargetDsn=d0pcrpt -param TargetUid=olapman -param TargetPwd=paic1234 -param IncStart=20150501 -param IncEnd=20150601 -param ExtractType=M -param $APT_CONFIG_FILE=/wls/dsadm/Ascential/DataStage/Configurations/default.apt PacrptPacrptM EpcisSasPasDestAllAcc03

dsjob -server 10.31.6.12 -user olapetl -password Paic1234 -run -jobstatus -warn 50 -param SourceDsn=d0pcrpt -param SourceUid=olapman -param SourcePwd=paic1234 -param TargetDsn=d0pcrpt -param TargetUid=olapman -param TargetPwd=paic1234 -param IncStart=20150501 -param IncEnd=20150601 -param ExtractType=M -param $APT_CONFIG_FILE=/wls/dsadm/Ascential/DataStage/Configurations/default.apt PacrptPacrptM EpcisSasPasDestAllAcc04

dsjob -server 10.31.6.12 -user olapetl -password Paic1234 -run -jobstatus -warn 50 -param SourceDsn=d0pcrpt -param SourceUid=olapman -param SourcePwd=paic1234 -param TargetDsn=d0pcrpt -param TargetUid=olapman -param TargetPwd=paic1234 -param IncStart=20150501 -param IncEnd=20150601 -param ExtractType=M -param $APT_CONFIG_FILE=/wls/dsadm/Ascential/DataStage/Configurations/default.apt PacrptPacrptM EpcisSasPasDestAllAcc05

dsjob -server 10.31.6.12 -user olapetl -password Paic1234 -run -jobstatus -warn 50 -param SourceDsn=d0pcrpt -param SourceUid=olapman -param SourcePwd=paic1234 -param TargetDsn=d0pcrpt -param TargetUid=olapman -param TargetPwd=paic1234 -param IncStart=20150501 -param IncEnd=20150601 -param ExtractType=M -param $APT_CONFIG_FILE=/wls/dsadm/Ascential/DataStage/Configurations/default.apt PacrptPacrptM EpcisSasPasDestAllAcc06

dsjob -server 10.31.6.12 -user olapetl -password Paic1234 -run -jobstatus -warn 50 -param SourceDsn=d0pcrpt -param SourceUid=olapman -param SourcePwd=paic1234 -param TargetDsn=d0pcrpt -param TargetUid=olapman -param TargetPwd=paic1234 -param IncStart=20150501 -param IncEnd=20150601 -param ExtractType=M -param $APT_CONFIG_FILE=/wls/dsadm/Ascential/DataStage/Configurations/default.apt PacrptPacrptM EpcisSasPasDestAllAcc07

dsjob -server 10.31.6.12 -user olapetl -password Paic1234 -run -jobstatus -warn 50 -param SourceDsn=d0pcrpt -param SourceUid=olapman -param SourcePwd=paic1234 -param TargetDsn=d0pcrpt -param TargetUid=olapman -param TargetPwd=paic1234 -param IncStart=20150501 -param IncEnd=20150601 -param ExtractType=M -param $APT_CONFIG_FILE=/wls/dsadm/Ascential/DataStage/Configurations/default.apt PacrptPacrptM EpcisSasPasDestAllAcc08

dsjob -server 10.31.6.12 -user olapetl -password Paic1234 -run -jobstatus -warn 50 -param SourceDsn=d0pcrpt -param SourceUid=olapman -param SourcePwd=paic1234 -param TargetDsn=d0pcrpt -param TargetUid=olapman -param TargetPwd=paic1234 -param IncStart=20150501 -param IncEnd=20150601 -param ExtractType=M -param $APT_CONFIG_FILE=/wls/dsadm/Ascential/DataStage/Configurations/default.apt PacrptPacrptM EpcisSasPasDestAllAcc09

dsjob -server 10.31.6.12 -user olapetl -password Paic1234 -run -jobstatus -warn 50 -param SourceDsn=d0pcrpt -param SourceUid=olapman -param SourcePwd=paic1234 -param TargetDsn=d0pcrpt -param TargetUid=olapman -param TargetPwd=paic1234 -param IncStart=20150501 -param IncEnd=20150601 -param ExtractType=M -param $APT_CONFIG_FILE=/wls/dsadm/Ascential/DataStage/Configurations/default.apt PacrptPacrptM EpcisSasPasDestAllNl01

dsjob -server 10.31.6.12 -user olapetl -password Paic1234 -run -jobstatus -warn 50 -param SourceDsn=d0pcrpt -param SourceUid=olapman -param SourcePwd=paic1234 -param TargetDsn=d0pcrpt -param TargetUid=olapman -param TargetPwd=paic1234 -param IncStart=20150501 -param IncEnd=20150601 -param ExtractType=M -param $APT_CONFIG_FILE=/wls/dsadm/Ascential/DataStage/Configurations/default.apt PacrptPacrptM EpcisSasPasDestAllNl02

dsjob -server 10.31.6.12 -user olapetl -password Paic1234 -run -jobstatus -warn 50 -param SourceDsn=d0pcrpt -param SourceUid=olapman -param SourcePwd=paic1234 -param TargetDsn=d0pcrpt -param TargetUid=olapman -param TargetPwd=paic1234 -param IncStart=20150501 -param IncEnd=20150601 -param ExtractType=M -param $APT_CONFIG_FILE=/wls/dsadm/Ascential/DataStage/Configurations/default.apt PacrptPacrptM EpcisSasPasDestAllNl03

dsjob -server 10.31.6.12 -user olapetl -password Paic1234 -run -jobstatus -warn 50 -param SourceDsn=d0pcrpt -param SourceUid=olapman -param SourcePwd=paic1234 -param TargetDsn=d0pcrpt -param TargetUid=olapman -param TargetPwd=paic1234 -param IncStart=20150501 -param IncEnd=20150601 -param ExtractType=M -param $APT_CONFIG_FILE=/wls/dsadm/Ascential/DataStage/Configurations/default.apt PacrptPacrptM EpcisSasPasDestAllNl04

dsjob -server 10.31.6.12 -user olapetl -password Paic1234 -run -jobstatus -warn 50 -param SourceDsn=d0pcrpt -param SourceUid=olapman -param SourcePwd=paic1234 -param TargetDsn=d0pcrpt -param TargetUid=olapman -param TargetPwd=paic1234 -param IncStart=20150501 -param IncEnd=20150601 -param ExtractType=M -param $APT_CONFIG_FILE=/wls/dsadm/Ascential/DataStage/Configurations/default.apt PacrptPacrptM EpcisSasPasDestAllNl05

dsjob -server 10.31.6.12 -user olapetl -password Paic1234 -run -jobstatus -warn 50 -param SourceDsn=d0pcrpt -param SourceUid=olapman -param SourcePwd=paic1234 -param TargetDsn=d0pcrpt -param TargetUid=olapman -param TargetPwd=paic1234 -param IncStart=20150501 -param IncEnd=20150601 -param ExtractType=M -param $APT_CONFIG_FILE=/wls/dsadm/Ascential/DataStage/Configurations/default.apt PacrptPacrptM EpcisSasPasDestAllNl06

dsjob -server 10.31.6.12 -user olapetl -password Paic1234 -run -jobstatus -warn 50 -param SourceDsn=d0pcrpt -param SourceUid=olapman -param SourcePwd=paic1234 -param TargetDsn=d0pcrpt -param TargetUid=olapman -param TargetPwd=paic1234 -param IncStart=20150501 -param IncEnd=20150601 -param ExtractType=M -param $APT_CONFIG_FILE=/wls/dsadm/Ascential/DataStage/Configurations/default.apt PacrptPacrptM EpcisSasPasDestAllNl07

dsjob -server 10.31.6.12 -user olapetl -password Paic1234 -run -jobstatus -warn 50 -param SourceDsn=d0pcrpt -param SourceUid=olapman -param SourcePwd=paic1234 -param TargetDsn=d0pcrpt -param TargetUid=olapman -param TargetPwd=paic1234 -param IncStart=20150501 -param IncEnd=20150601 -param ExtractType=M -param $APT_CONFIG_FILE=/wls/dsadm/Ascential/DataStage/Configurations/default.apt PacrptPacrptM EpcisSasPasDestAllNl08

dsjob -server 10.31.6.12 -user olapetl -password Paic1234 -run -jobstatus -warn 50 -param SourceDsn=d0pcrpt -param SourceUid=olapman -param SourcePwd=paic1234 -param TargetDsn=d0pcrpt -param TargetUid=olapman -param TargetPwd=paic1234 -param IncStart=20150501 -param IncEnd=20150601 -param ExtractType=M -param $APT_CONFIG_FILE=/wls/dsadm/Ascential/DataStage/Configurations/default.apt PacrptPacrptM EpcisSasPasDestAllNl09

时间: 2024-10-05 23:59:18

报表名称:前线销售人力表的相关文章

根据字段名称查找所在的表名

SELECT name FROM sys.sysobjects SO WHERE EXISTS ( SELECT * FROM syscolumns SC WHERE name LIKE 'Reason' AND SC.id = SO.id ) 根据字段名称查找所在的表名

在线报表设计实战系列 – ⑥矩表高级应用

葡萄城报表是一套强大的报表开发和系统搭建工具,既能与您开发的报表软件项目紧密集成,也可独立部署运行,支持多数据源,具有无编码.灵活.稳定等特性,可以帮您快速搭建专业的报表软件系统,实现各类报表的设计.管理.权限控制.数据填报.负载均衡及跨平台发布. 葡萄城报表提供了两个表格类报表元素:普通表格和矩表.前者用于表格列固定不变的应用场合,后者用于表格列根据数据记录动态设置的应用场合.矩表实现动态列的关键是列分组,事实上,矩表也可以不设置动态列,这样就可以用矩表实现普通表格的效果.尤其是,在多层表头的

JasperReport报表开发之转置交叉表

使用Jasper或BIRT等报表工具时,常会碰到一些非常规的统计,用报表工具本身或SQL都难以处理,比如源数据不符合交叉表的要求,需要转置后再呈现.集算器具有结构化强计算引擎,集成简单,可以协助报表工具方便地实现此类需求.下面通过一个例子来说明转置交叉表的实现过程. 数据库表booking汇总着各年度商品的预定数据,有四个字段,包括年份和三种预定状态,部分数据如下: 报表要求呈现指定年份及上一年的预定情况,其中行组有三项,即三种预定状态,列组是年份,测度是当年的预定数据.此外要汇总出指定年份各预

数据库小记:根据指定名称查询数据库表名及根据指定名称查询数据库所有表中的字段名称(支持mysql/postgre)

意:本篇文章仅适用于mysql和postgre这两种数据库 1.查询数据库中所有表名及对应表的详细信息 select * from INFORMATION_SCHEMA.tables 2.根据指定名称查询表名(也可模糊查询,可查询表的详细信息) select *  from INFORMATION_SCHEMA.tables where table_name = 'eguid'; select * from INFORMATION_SCHEMA.tables where table_name l

RGB颜色名称与色值对应表

实色效果 英文名称 R.G.B 16色 实色效果 英文名称 R.G.B 16色   Snow 255 250 250 #FFFAFA   PaleTurquoise1 187 255 255 #BBFFFF   GhostWhite 248 248 255 #F8F8FF   PaleTurquoise2 174 238 238 #AEEEEE   WhiteSmoke 245 245 245 #F5F5F5   PaleTurquoise3 150 205 205 #96CDCD   Gain

正则表达式替换报表名称中的特殊字符

// 表达式对象 Pattern p = Pattern. compile("[\\\\?\\*\\:\\[\\]\\/]"); // 创建 Matcher 对象 Matcher n = p.matcher(systemName); Matcher m = p.matcher(unitCodeName); // 替换 String sheetNameSystem = n.replaceAll( ""); String sheetNameUnit = m.replac

报表打开对应的对应表单

using System; using System.Collections.Generic; using System.Linq; using System.Text; using Kingdee.BOS.Core.Report.PlugIn; using System.ComponentModel; using Kingdee.BOS.Core.DynamicForm; using Kingdee.BOS.ServiceHelper; using Kingdee.BOS.Orm.DataEn

串口编程-枚举遍历串口、获取PC所有串口名称、遍历注册表项、RegEnumValue用法

在网上找了几个关于遍历串口的例子,要么代码不完整,要么就有Bug,如读不了串口号大于10以上的. 经过本人的整理,现分享最终代码,vs2008下编译通过. //此方法同样适用于遍历windows开机启动项,只需稍加修改即可. void CEnumPortDlg::enumPort(void) { HKEY hKey; LPCTSTR lpSubKey="HARDWARE\\DEVICEMAP\\SERIALCOMM\\"; if(RegOpenKeyEx(HKEY_LOCAL_MACH

新人成长

新人成长跟踪表设计方案潘强是此需求的BA,座机号码:621595欧阳恩坤是SAS系统组的开发,此需求在源头系统取数上有任何疑问都可以请教他,座机号码:608142 开发此报表前,请先阅读“前线销售人力表”报表的加工逻辑,附件”前线销售人力表整理.txt“是我整理的,可以参考 维度的设计 统计时间 年.月机构 区域细分至二三四级机构渠道 直销/重客/银保/综拓/代理/车行/新渠道人员类别 VP/VA/M/S年龄区间 分为25岁以下.25-30岁.30-35岁.35-40岁.40-50岁.50岁以上