BookmarkSubscribeRSS Feed
k9rescue
Calcite | Level 5

I've got a character field named Butterflies.  I've got a numeric field named Test.  Test values are 1-6.   I'm trying to create a vbar where all the Test values are represented, even if there is no data for them.   This will make the graphic colors across all charts the same.  I tried the code below, but it's ignoring the midpoints do not match the variable type.  Any idea what's going on?

PROC GCHART DATA=mydata

;

  VBAR3D

  Butterflies

/

  SUBGROUP=Test

/* Start of custom user code. */

patternid = subgroup

/* End of custom user code. */

  SHAPE=BLOCK

FRAME TYPE=FREQ

  MISSING

PCT

  LEGEND=LEGEND1

  COUTLINE=BLACK

  RAXIS=AXIS1

  MAXIS=AXIS2

/* Start of custom user code. */

discrete

midpoints=1 2 3 4 5 6;

1 REPLY 1
ballardw
Super User

When I have a similar need I usually join the data to a data set with all of the categorical variables. If the value isn't in the data set then GCHART can't do anything with it.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 1 reply
  • 702 views
  • 0 likes
  • 2 in conversation