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

Hello,

           I have a dataset with a few missing dates. I am trying to plot time(year/month) vs rates. When I plot my graph using sgplot grouping by year, it produces icons of all the relevant years as well as the missing dates (in grey) in the legend. There is no grey line plot. Is there a way of fixing this if I am not able to correct the missing dates? How can I remove the grey icon that shows missing dates? is it the proper way to solve it?

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

On the SERIES statement, include the NOMISSINGGROUP option, which specifies that missing values of the group variable are not included in the plot.

View solution in original post

5 REPLIES 5
pearson101
Calcite | Level 5

Here is the code I use

```

proc sgplot data=mean_kola_num;
styleattrs datacontrastcolors=(blue red green brown);
series x=month_name y=mean_t_b / group=annee markers
legendlabel="original" ;
xaxis label='Month';
yaxis label='Average';
run;

```

Reeza
Super User
You can add a WHERE statement to filter out missing values?
Fill in the variable name as needed.

Where not missing(variable) and not missing(variable) and not missing(variable);

pearson101
Calcite | Level 5

Thank you, would that go in the sgplot section?

Reeza
Super User
Yes, WHERE statements generally go after the PROC statement (good practice) and can go in almost every PROC/DATA STEP in SAS.
Rick_SAS
SAS Super FREQ

On the SERIES statement, include the NOMISSINGGROUP option, which specifies that missing values of the group variable are not included in the plot.

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
  • 5 replies
  • 1870 views
  • 0 likes
  • 3 in conversation