I've been searching for a few hours but still can't figure out how to create a basic bar chart in SAS.

For example, my data looks has 3 columns: Year, State, Company, and sales.

Suppose I just want to create a basic bar chart to compare sales of different states in one graph, how would I do it? and what is the difference between plot, gchart, gplot etc etc? There's quite a few that I do not know when to use what.

My code:

Proc gchart data=work.nbcounts;

vbar sales/ type=sum group=State;

run;

I tried I with and without the group statement, but that didn't work. I tried by state;, but that did not work either.

what I"M getting is I'm getting the sales numbers at the x axis, and the frequency of that number, which is not what I want. All I'm wanting is sum of total sales by state. So state on the x-axis, and sales on the Y.

For example, my data looks has 3 columns: Year, State, Company, and sales.

Suppose I just want to create a basic bar chart to compare sales of different states in one graph, how would I do it? and what is the difference between plot, gchart, gplot etc etc? There's quite a few that I do not know when to use what.

My code:

Proc gchart data=work.nbcounts;

vbar sales/ type=sum group=State;

run;

I tried I with and without the group statement, but that didn't work. I tried by state;, but that did not work either.

what I"M getting is I'm getting the sales numbers at the x axis, and the frequency of that number, which is not what I want. All I'm wanting is sum of total sales by state. So state on the x-axis, and sales on the Y.

Last edited: