data gkpi;
input North_Sales North_Target;
cards;
750 600
;
run;
data actual_1;
set GKPI;
call symput("mac_actual_1",'North_Sales'n);
call symput("mac_target_1",'North_Target'n);
run;
data bounds;
if &mac_actual_1 < 0 then do;
if &mac_actual_1 > -1 then do;
call symput("mac_b1",-1.00);
call symput("mac_b2",-.75);
call symput("mac_b3",-.25);
call symput("mac_b4",0);
end;
else if &mac_actual_1 > -10 then do;
call symput("mac_b1",-10);
call symput("mac_b2",-7.5);
call symput("mac_b3",-2.5);
call symput("mac_b4",0);
end; else if &mac_actual_1 > -25 then do;
call symput("mac_b1",-25);
call symput("mac_b2",-20);
call symput("mac_b3",-10);
call symput("mac_b4",0);
end;
else if &mac_actual_1 > -50 then do;
call symput("mac_b1",-50);
call symput("mac_b2",-35);
call symput("mac_b3",-15);
call symput("mac_b4",0);
end;
else if &mac_actual_1 > -75 then do;
call symput("mac_b1",-75);
call symput("mac_b2",-50);
call symput("mac_b3",-25);
call symput("mac_b4",0);
end;
else if &mac_actual_1 > -100 then do;
call symput("mac_b1",-100);
call symput("mac_b2",-75);
call symput("mac_b3",-25);
call symput("mac_b4",0);
end;
else if &mac_actual_1 > -1000 then do;
call symput("mac_b1",-1000);
call symput("mac_b2",-750);
call symput("mac_b3",-250);
call symput("mac_b4",0);
end;
else if &mac_actual_1 > -10000 then do;
call symput("mac_b1",-10000);
call symput("mac_b2",-7500);
call symput("mac_b3",-2500);
call symput("mac_b4",0);
end;
else do;
b1=round(&mac_actual_1*2,1000);
call symput("mac_b1",b1);
b2=round(b1/2);
call symput("mac_b2",b2);
b3=round(b2/2);
call symput("mac_b3",b3);
call symput("mac_b4",0);
end;
end;
else if &mac_actual_1 >=0 then do;
if &mac_actual_1 <=1 then do;
call symput("mac_b1",0);
call symput("mac_b2",.25);
call symput("mac_b3",.75);
call symput("mac_b4",1);
end;
else if &mac_actual_1 <=10 then do;
call symput("mac_b1",0);
call symput("mac_b2",2.5);
call symput("mac_b3",7.5);
call symput("mac_b4",10);
end;
else if &mac_actual_1 <=25 then do;
call symput("mac_b1",0);
call symput("mac_b2",10);
call symput("mac_b3",20);
call symput("mac_b4",25);
end;
else if &mac_actual_1 <=50 then do;
call symput("mac_b1",0);
call symput("mac_b2",15);
call symput("mac_b3",35);
call symput("mac_b4",50);
end;
else if &mac_actual_1 <=75 then do;
call symput("mac_b1",0);
call symput("mac_b2",25);
call symput("mac_b3",50);
call symput("mac_b4",75);
end;
else if &mac_actual_1 <=100 then do;
call symput("mac_b1",0);
call symput("mac_b2",25);
call symput("mac_b3",75);
call symput("mac_b4",100);
end;
else if &mac_actual_1 <=1000 then do;
call symput("mac_b1",0);
call symput("mac_b2",250);
call symput("mac_b3",750);
call symput("mac_b4",1000);
end;
else if &mac_actual_1 <=10000 then do;
call symput("mac_b1",0);
call symput("mac_b2",2500);
call symput("mac_b3",7500);
call symput("mac_b4",10000);
end;
else if &mac_actual_1 <=100000 then do;
call symput("mac_b1",0);
call symput("mac_b2",25000);
call symput("mac_b3",75000);
call symput("mac_b4",100000);
end;
else if &mac_actual_1 <=1000000 then do;
call symput("mac_b1",0);
call symput("mac_b2",250000);
call symput("mac_b3",750000);
call symput("mac_b4",1000000);
end;
else if &mac_actual_1 <=10000000 then do;
call symput("mac_b1",0);
call symput("mac_b2",2500000);
call symput("mac_b3",7500000);
call symput("mac_b4",10000000);
end;
else if &mac_actual_1 <=100000000 then do;
call symput("mac_b1",0);
call symput("mac_b2",25000000);
call symput("mac_b3",75000000);
call symput("mac_b4",100000000);
end;
end;
run;
goptions reset=all device=javaimg vsize= 2.50 in hsize= 2.50 in;
proc gkpi mode=raised;
speedometer actual=&mac_actual_1 bounds= (&mac_b1 &mac_b2 &mac_b3 &mac_b4) /
target=&mac_target_1
label='North Sales' lfont=( h= 20 PT c= CX3366FF)
colors=(cxD06959 cxF1DC63 cx84AF5B );
run;
quit;
|