Hi @PGStats, I updated the 'group by" in the code - see below. still getting the same duplicates. Product # ADJ_REASON_CODE CODE ADJ_ACTIVITY1_CATG gl_DESC1 ADJ_ACTIVITY2_CATG CM APRIL_AMOUNT PM MARCH_AMOUNT 50000683 DISCOA SBACT60 Pricing Contra Activation/Port-in Credits 2018-03 60 50000683 DISCOA SBACT60 Pricing Contra Activation/Port-in Credits 2018-04 60 50001288 DISCOA SBACT60 Pricing Contra Activation/Port-in Credits 2018-03 60 50002333 DISCOA SBACT60 Pricing Contra Activation/Port-in Credits 2018-03 60 50002333 DISCOA SBACT60 Pricing Contra Activation/Port-in Credits 2018-04 60 proc sql; create table SegmentALL as
select distinct
SUBSCRIBER_NO,
ADJ_REASON_CODE,
DISCOUNT_CODE,
ADJ_ACTIVITY1_CATG,
gl_DESC1,
segment,
ADJ_ACTIVITY2_CATG,
case repMTD_CD when 'CM' then repMTH end as CM,
case repMTD_CD when 'CM' then SAP_AMOUNT end as APRIL_AMOUNT,
case repMTD_CD when 'CM' then Instances end as APRIL_Transactions,
case repMTD_CD when 'PM' then repMTH end as PM,
case repMTD_CD when 'PM' then SAP_AMOUNT end as MARCH_AMOUNT,
case repMTD_CD when 'PM' then Instances end as MARCH_Transactions
from CATSegmentRepAll
group by
SUBSCRIBER_NO,
ADJ_REASON_CODE,
DISCOUNT_CODE,
ADJ_ACTIVITY1_CATG,
gl_DESC1,
segment,
ADJ_ACTIVITY2_CATG
;QUIT;
... View more