BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello All,
I am running into an issue when I try to report all the activity for the previous month. There are 2 issues my month is not the same as the calendar month(meaning the a school_month can span between 2 calendar months) I have a table which gives me the start date and end date for each school_month with the month_number. I also have a column where I can check what the current school month is, but I am not able to filter on the data for the previous month. Here is how the data is


m_start_date m_end_date s_month curr_s_month
8/25/09 9/22/09 1
9/23/09 10/22/09 2


4/15/10 5/12/10 8
5/13/10 6/10/10 9 9 ( because today's date falls in this range)

and I want to display all records for
s_month=8 until cur_month = 9 and
s_month = 9 when cur_month = 10

Is this even possible......

I appreciate any input you have. And thanks to all of you I have been able to use SAS in a much more efficient way.

Thanks
Shri
2 REPLIES 2
AngelaHall
SAS Employee
Shri,
Within the IMAP Filter creation screen, after selecting s_month = 8, click 'Add', then select cur_month < 9, then click 'Add'. You will then have both criteria within a single filter available for use. (You can view the filter expression by clicking the '+' to expand that area of the filter screen.)

~ Angela
http://sas-bi.blogspot.com
jplarios
Quartz | Level 8
Shri,

What we do is have attributes on the dimension loaded during ETL- this might be more helpful when dealing with non-standard dates.
In the dimension in question, the attribute could be called Current Month and the value at the current month will always be "Current Month". The Previous value would be called " Previous Month".
With this you could schedule your reports to WHERE Current = " "Previous Month".

You might need to proc format to sort.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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