-DEFAULT &MYYEAR = 2015 ;
-DEFAULT &MYMONTH = 3 ;
-SET &ENDYYM = &MYYEAR * 100 + &MYMONTH ;
-SET &startyym = AYM(&ENDYYM , -13 , 'I6YYM');
-SET &bar1_start = &startyym ;
-SET &bar1_end = AYM(&startyym , 11 , 'I6YYM');
-SET &bar2_start = AYM(&startyym, 1 , 'I6YYM');
-SET &bar2_start = AYM(&bar2_start, 11 , 'I6YYM');
-SET &bar3_start = AYM(&startyym, 2 , 'I6YYM');
-SET &bar3_start = AYM(&bar3_start, 11 , 'I6YYM');
-? &b
-* that command will show you the &vars you've calculated so far
-*
DEFINE FILE THING
DATEYYM/A6 = YEAR | MONTH ;
END
TABLE FILE THING
SUM VALUE
AND COMPUTE bar1/I8 MISSING ON =IF DATEYYM FROM &bar1_start TO &bar1_end THEN VALUE ELSE MISSING ;
AND COMPUTE bar2/I8 MISSING ON =IF DATEYYM FROM &bar2_start TO &bar2_end THEN VALUE ELSE MISSING ;
AND COMPUTE bar3/I8 MISSING ON =IF DATEYYM FROM &bar3_start TO &bar3_end THEN VALUE ELSE MISSING ;
BY EMGROUP
BY DATEYYM
IF DATEYYM FROM &STARTYYM TO &ENDYYM
ON TABLE HOLD
END
-RUN
-* now take a peek at your data to make sure you like it, then proceed
GRAPH FILE HOLD
SUM AVE.bar1 AVE.bar2 AVE.bar3
BY EMGROUP
...whatever else you need
END
| In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID |