04-06-2018 09:24 AM
I have one column name "month" which has 31 months
what i want to do is i want to limit number of months
for example :- Current Month followed by two future months and two previous month followed by current month
Like if current month is April then it has to show something like
FEb-MAR-APR(Current month)-MAY- JUN
Any one know, How we can do it in SAS VA 7.4?
Thanks in advance
04-06-2018 06:37 PM
One easy way to deal with this is to add a numeric month identifier variable to your data prior to loading into VA. Set current month data to 0, last month data to -1 and so on. Set next month +1 and so on. If you have a reporting date in your data it is easy to create this variable:
Month_Counter = intck('MONTH', today(), reporting_date);
You can then use the Month_Counter as a filter in all of your reports. For example where Month_Counter between -2 and +2 will select the months you want.
05-01-2018 04:20 AM
I tried but not getting it, how to do it as I don't have any reporting date and my month is in char format to convert it to date, I am using following code
input(month, dtdtm.) as new_month format=dtdate9.,
and how I will create the month identifier for it?
I am new to it
05-02-2018 02:47 AM
- Convert the character date to sas date using your input function. Lets say you call it date_num
- create a new date variabel which is 2 months greater than the new date variable using intnx('month',date_num,2). Lets say you call it date_num_plus2
- in VA create a prompt on date_num_plus2. Add a date parameter and assign it to the prompt.
- Create a data filter that selects month <= the parameter.
- In your visualizations use rank and pick the highest 6 on date_num.
Some work, but I think it would work
05-02-2018 07:42 AM
No requirement is little different.
I am using cross Tab and I want to filter it there and it should change automatically for every current month.
if May is (Current month)
then it should show Feb-mar-apr(3 previous months)
and Jun-July(2 future months)
So in addition likewise it should change automatically for every current month without doing any changes.
I created two fields min date and max date
intnx('month',input(metric_month,anydtdte20.),-3) as min_date format=date9.,
intnx('month',input(metric_month,anydtdte20.),+2) as max_date format=date9.,
and when i am filtering it in cross tab using "month between incl max & min" its not filtering the months