互联网服务 商业智能

Transformer数据源的一个查询中存在多个时间限制条件,应如何处理?(急)

我是用FM发包,用TS进行整合。下面的代码是其中的一个。这个时间我不知道应该如何写,模型搭建有没有好的建议。网上查过一些资料没有类似的。如果您知道的话,请邮箱联系我lianglei16233@1633.com .待问题解决之后我在将解决的过程补充上去。

select  

        dm.ProvComCode ,

        case when dp.MarkeType in ('2', '3', '4', '5', '6', '7', '8', '99', '10', '11', '12', '13', '14', '15') then '6'

        when dp.BranchType = '4' then '1'

        else dp.BranchType

        end ,

        count (distinct da.agentcode)

from dm_payevent dp

inner join (

        select

                a.agentcode,

                a.agentid

                from d_agent a

        inner join d_agent b on a.agentcode=b.agentcode and b.nowstate='1'

        where b.employdate <= '2016-01-31'                                           --查询止期

        and ( b.outworkdate > '2016-01-31'  or  b.outworkdate is null)     --查询止期

        ) da on dp.agentid=da.agentid

inner join D_ManageCom dm on dm.managecomid=dp.managecomid

inner join D_Policy dpo on dp.polid = dpo.polid

where dp.agentid=da.agentid

and dpo.signdate >='2016-01-01'   --查询起期

and dpo.signdate <= '2016-01-31'  --查询止期

group by dm.ProvComCode ,

        case when dp.MarkeType in ('2', '3', '4', '5', '6', '7', '8', '99', '10', '11', '12', '13', '14', '15') then '6'

        when dp.BranchType = '4' then '1'

        else dp.BranchType

        end

参与6

提问者

ll16233
商业智能工程师 GBICC
擅长领域: 大数据商业智能服务器
评论27

相关问题

相关资料

问题状态

  • 发布时间:2016-02-25
  • 关注会员:3 人
  • 问题浏览:2944
  • 最近回答:2016-02-26
  • X社区推广