Desktop productivity for business analysts and programmers

Bar Plot With Specified Bar Values

Reply
New Contributor
Posts: 4

Bar Plot With Specified Bar Values

Hi ,

 

One of my colleagues has the following question regarding to the Bar plot in SAS Enterprise guide.

 

"See the following table:

days    amount

1          10

31        20

60         5

 

When I generate the bar plot to sum up the amount based on different days, with bar values specified to be 30 and 60. The bar plot has two bars, one is at value 30 which has an amount of 10+20=30, the other bar is at value 60, and has value 5. Why is the first bar value (i.e., 30) also includes the second row? Shouldn't the bar chart value be 10 and 25 in this case?

 

How is the categorization done? Isn't it days<=30, and days between 30 and 60?

"

Thanks in advance

 

 

Super User
Posts: 11,134

Re: Bar Plot With Specified Bar Values

Post the code that generates the issue. There are enough options we don't want to guess. Also are any custom formats involved?

New Contributor
Posts: 4

Re: Bar Plot With Specified Bar Values

Hi,

 

You could find the code that generates issue below. Thanks in advance.

 

PROC SQL;
 CREATE VIEW WORK.SORTTempTableSorted AS
  SELECT T.days, T.amount
 FROM WRK.ding_bar_temp as T
;
QUIT;
Axis1
 STYLE=1
 WIDTH=1
 MINOR=NONE


;
Axis2
 STYLE=1
 WIDTH=1


;
TITLE;
TITLE1 "Bar Chart";
FOOTNOTE;
FOOTNOTE1 "Generated by the SAS System (&_SASSERVERNAME, &SYSSCPL) on %TRIM(%QSYSFUNC(DATE(), NLDATE20.)) at %TRIM(%SYSFUNC(TIME(), TIMEAMPM12.))";
PROC GCHART DATA=WORK.SORTTempTableSorted
;
 VBAR
  days
 /
 SUMVAR=amount
 CLIPREF
FRAME MIDPOINTS=30 TO 60 BY 30
 TYPE=SUM
 COUTLINE=BLACK
 RAXIS=AXIS1
 MAXIS=AXIS2
;
/* -------------------------------------------------------------------
   End of task code.
   ------------------------------------------------------------------- */
RUN; QUIT;
%_eg_conditional_dropds(WORK.SORTTempTableSorted);
TITLE; FOOTNOTE;

Ask a Question
Discussion stats
  • 2 replies
  • 271 views
  • 0 likes
  • 2 in conversation