I have a problem with setting up two graphics, one is fine, as in the bottom,
while the other comes out so I don't know what it's caused by. The appendix in the second chart converts dates to some numerical values.
This is my code:
*/GRAPH #1*/
proc summary data=diff nway;
class policy_vintage;
format policy_vintage vintf.;
var POLICY_TODAY POLICY_PRIOR;
output out=newdiff sum=;
proc sql;
create table diff1 as
select today.policy_vintage as policy_vintage
, POLICY_TODAY
, POLICY_PRIOR
, POLICY_TODAY - POLICY_PRIOR as DIFFRENCE
from newdiff today
LEFT JOIN
(select *
from _work.POLICY_VINTAGE_WEEKLY
where run_date < today()
having run_date = max(run_date)
) prior
ON today.policy_vintage = prior.policy_vintage
;
quit;
/*GRAPH #2 /
proc summary data=tablea_new nway;
class policy_vintage;
format policy_vintage vintf.;
var AKTYWNE WYGASLE;
output out=newtabe sum=;
proc sql;
create table diff_policy as
select
today.policy_vintage
, today.WYGASLE as EXPIRED_TODAY
, prior.WYGASLE as EXPIRED_PRIOR
, today.AKTYWNE as ACTIVE_TODAY
, prior.AKTYWNE as ACTIVE_PRIOR
, today.WYGASLE - prior.WYGASLE as DIFF_EXP
, today.AKTYWNE - prior.AKTYWNE as DIFF_ACT
from newtabe today
LEFT JOIN
(select *
from _work.policy_weekly
where run_date < today()
having run_date = max(run_date)
) prior
ON today.policy_vintage = prior.policy_vintage
;
quit;
... View more