I'm trying to build a filter within a crosstab to automatically filter the date.
I have 14 months of data, Dec 16' - Jan 18', but I only want to show data from 4 months ago (This month that would be Oct. 17'). My data set updates each month by rolling forward one month (e.g. my next data set will have dates raning from 1/1/17 - 2/28/18) and I will need the filter to grab data from Nov. 17' only.
I currently have this as the syntax of the filter but it is not working correctly.
DatePart(AppVintage) = DateFromMDY(( Month(DatePart(Now())) - 4 ), 1, Year(DatePart(Now())))
The format of the date field (AppVintage) is DATETIME22.3
Can someone help me with this issue?
I don't use VA so I'm not sure of all the functions that may be available. If you have the INTNX function that will increment date, time and datetime values.
AppVintage = intnx('dtmonth',now(),-4,'B');
which if the function intnx is available should return the time of the beginning day of the month 4 previous.
If a base SAS function such as INTNX or INTCK would be helpful and isn't available in VA you might consider posting a request to add them in the SASWare Ballot section of the forum: https://communities.sas.com/t5/SASware-Ballot-Ideas/idb-p/sas_ideas
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.