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!
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.
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
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.