0
%let MTDAvg = 33.3;

proc sgplot data=mydata ;
vbarparm category=Day response=Sale1 / group=Dow barwidth=0.7 nooutline datalabel dataskin=pressed name="Daily"; 
series x=Day y=Sale2 / lineattrs=(color=grey pattern=solid thickness=1.5) name="Weekly" ;
series x=Day y=Sale3 / lineattrs=(color=red pattern=solid thickness=2) curvelabel='Avg:%cmpres(&MTDAvg)';
keylegend "Daily" / position=topright noborder autoitemsize;
xaxis display=(nolabel) offsetmax=0.08 labelattrs=(color=pab size=0.5); 
yaxis grid min=10 max=55;
inset 'Avg:%cmpres(&MTDAvg)' / noborder position=topright;
run;

Use above code, inset statement will place Avg:33.3 on the topright corner. But curvelabel cannot resolve macro variable and returns 'Avg:%cmpres(&MTDAvg) at the end of series series x=Day y=Sale3.

Lovnlust
  • 1,507
  • 3
  • 29
  • 53

1 Answers1

1

Looks like it might be a simple fix, you need " around macro variables, not '.

Apkl
  • 59
  • 3