teddysnow12
Programmer
Hi,
The following is my code,
select
sum(mms.plcy_holdr_mnth_cnt) as curre ,
'Enrolled Employees' as measure
from mbr.mbr_mnth_fact mms ,
mbr.mnth_dim mt,
mbr.PRDCT_dim_old pd ,
mbr.grp_structr_dim gsd ,
cmrcl_wlns.grp_dim@HM_LINK gd
where mt.yyyymm_cd = MMS.RPTG_YYYYMM
and MMS.PRIMRY_MEDCL_PRDCT_CD_HSN = PD.PRDCT_CD_HIST_SEQ_NBR
and gsd.grp_structr_hist_seq_nbr = mms.grp_structr_hist_seq_nbr
and gsd.MBR_GRP_NBR = gd.mbr_grp_nbr
and gd.ftn_grp_nme = '50 BELOW'
AND gd.ftn_nbr = '42958'
and mt.yyyymm_cd = '2011-03'
and pd.dw_funding_type_cd = 'F'
and pd.dw_bus_seg_cd = 'Mmkt'
AND PD.DW_MKT_SEG_CD = 'C'
AND GD.MBR_GRP_NBR = '46854'
group by
GD.mbr_grp_nbr
The RPTG_YYYYMM changes from 2011-03 to 2010-03 and rest of the code remains same.
I need the 'enrolled members' for 2011-03 and also 2010-03.
can anyone help me out in writing the case statement for this code.
Thanks in advance!
The following is my code,
select
sum(mms.plcy_holdr_mnth_cnt) as curre ,
'Enrolled Employees' as measure
from mbr.mbr_mnth_fact mms ,
mbr.mnth_dim mt,
mbr.PRDCT_dim_old pd ,
mbr.grp_structr_dim gsd ,
cmrcl_wlns.grp_dim@HM_LINK gd
where mt.yyyymm_cd = MMS.RPTG_YYYYMM
and MMS.PRIMRY_MEDCL_PRDCT_CD_HSN = PD.PRDCT_CD_HIST_SEQ_NBR
and gsd.grp_structr_hist_seq_nbr = mms.grp_structr_hist_seq_nbr
and gsd.MBR_GRP_NBR = gd.mbr_grp_nbr
and gd.ftn_grp_nme = '50 BELOW'
AND gd.ftn_nbr = '42958'
and mt.yyyymm_cd = '2011-03'
and pd.dw_funding_type_cd = 'F'
and pd.dw_bus_seg_cd = 'Mmkt'
AND PD.DW_MKT_SEG_CD = 'C'
AND GD.MBR_GRP_NBR = '46854'
group by
GD.mbr_grp_nbr
The RPTG_YYYYMM changes from 2011-03 to 2010-03 and rest of the code remains same.
I need the 'enrolled members' for 2011-03 and also 2010-03.
can anyone help me out in writing the case statement for this code.
Thanks in advance!