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

yiyhio_1-1625486067461.png

 

So I have this graph in VA, with purple representing sales in 2021, brown-ish 2020 sales and blue 2019 sales. As you can see, it seems as though sales has gone through the floor in July - but that's because we've only reached four days into the month. My question is then - how do I dynamically take away observations from the current month?

 

Adding checkboxes per month and connecting to the graph won't work, as it will also take away observations done in prior years, i.e checking july will take away the disturbing jul21-observation, but also jul-20 and jul-19.. Adding period checkboxes, like 0521, 0621, 0721 etc. does provide the wanted result, but includes checking lots and lots of boxes to generate the wanted graphs. So how can this be solved dynamically? 

 

Thanks in advance for all help!

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

How often do you update your VA data? To deal with this type of problem you can create a "month counter" in your data. For example, current month = 0, last month = 1, month before last = 2 and so on. Now you can create a static filter on your data of Month_Counter > 0.  

View solution in original post

2 REPLIES 2
sbxkoenk
SAS Super FREQ

Hello,

 

I guess you prepare your VA data source for the plot somewhere with a program that you run on a regular basis (like twice a day).

You can get rid of all dates within the current month with some additional statements.

Something like this:

data want;
 *set have;
 current_day=today();
 *if put(your_date,MONYY7.)=put(current_day,MONYY7.) then delete;
 format current_day MONYY7.;
run;
/* end of program */

The * are there to avoid the program fails if you submit it as such.

 

Koen

SASKiwi
PROC Star

How often do you update your VA data? To deal with this type of problem you can create a "month counter" in your data. For example, current month = 0, last month = 1, month before last = 2 and so on. Now you can create a static filter on your data of Month_Counter > 0.  

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 347 views
  • 0 likes
  • 3 in conversation