BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Greek
Obsidian | Level 7

Good morning,

I am trying to figure out why isn't the option "tickvalueformat" working. I modified my code for your convenience by adding a step with datalines. It should run without you having to do anything. I get numbers 3-7 in the xaxis instead of the months March-July...

Does anybody know what's wrong?

data vbar;

length combined $30;

input month $ month_numeric combined $ Hours @@;

datalines;

March    3    compensation    148.9

March    3    projects        31.1

April    4    compensation    148.5

April    4    projects        36.5

May        5    compensation    114.9

May        5    projects        50.3

June    6    compensation    73.7

June    6    projects        113.4

July    7    compensation    102.3

July    7    projects        73.8

run;

proc format;

value monthly

3='March'

4='April'

5='May'

6='June'

7='July'

;

run;

proc sgplot data=vbar;

vbar month_numeric/response=hours group=combined groupdisplay=cluster;

xaxis tickvalueformat=monthly;

run;

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

Do it this way, and it will work for you:

proc sgplot data=vbar;

format month_numeric monthly.;

vbar month_numeric/response=hours group=combined groupdisplay=cluster;

run;

View solution in original post

2 REPLIES 2
DanH_sas
SAS Super FREQ

Do it this way, and it will work for you:

proc sgplot data=vbar;

format month_numeric monthly.;

vbar month_numeric/response=hours group=combined groupdisplay=cluster;

run;

Greek
Obsidian | Level 7

Thank you so much!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2568 views
  • 0 likes
  • 2 in conversation