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 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 2946 views
  • 0 likes
  • 3 in conversation