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
Post the code that generates the issue. There are enough options we don't want to guess. Also are any custom formats involved?
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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.