BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
djbateman
Lapis Lazuli | Level 10

I'm using GTL to make several bubble plots.  I am making a different plot for a different adverse event where the bubbles are color coded by AE grade.  When I subset my data to certain AE terms, not all grades are represented.  For example, when I run the Fatigue plot, Grade 1, Grade 2, and Grade 3 show up, but Grade 4 is not in the legend because there are no Grade 4 Fatigue in my data.  There are some graphs that only show Grade 1 in the legend.  I just want the Grade 4 to appear in the legend so that all legends are consistent across all plots.

 

Is there a way in the DISCRETELEGEND statement to specify what values to display (i.e., display all 4 grades)?  I am sure I have done this in the past, but I can't find any sample code.  Google is also not being much of a help.  I am trying to not run some kind of massive shell table that has all possible combinations of subject ID, AE term, and grade level and then merge in my actual data to have a bunch of missing values.  Can I avoid doing that?

1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

If you are using an inline DISCRETEATTRMAP statement inside GTL, you can set the option DISCRETELEGENDENTRYPOLICY=ATTRMAP to get all values from the attrmap into the legend associated with the plot statement, in the order they are provided in the attr map.  If you are using an external DataSet based DAttrMap, you can set the SHOW column to "ATTRMAP".

View solution in original post

3 REPLIES 3
Jay54
Meteorite | Level 14

If you are using an inline DISCRETEATTRMAP statement inside GTL, you can set the option DISCRETELEGENDENTRYPOLICY=ATTRMAP to get all values from the attrmap into the legend associated with the plot statement, in the order they are provided in the attr map.  If you are using an external DataSet based DAttrMap, you can set the SHOW column to "ATTRMAP".

djbateman
Lapis Lazuli | Level 10

How easy was that!  Luckily, I am using DISCRETEATTRMAP, so this was probably the easiest fix.  Thank you so much.  There are so many options out there that I usually don't even know what I'm looking for.

 

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
  • 3 replies
  • 2335 views
  • 3 likes
  • 3 in conversation