I want to create a dynamic filter, which always gives me the previous 12 months from a date variable.
For example, if I run the query today, on the 24th of February 2021, I want data between the 1st of February 2020 to the 31st of January 2021.
I have tried the INTNX function, but I can't get it to do what I want.
How do I do this?
For your future benefit, saying "it didn't work" and not showing us what you did never helps. Show us what you did.
if intnx('month',today(),-12,'b')<=variable<=intnx('month',today(),-1,'e') then ...
For your future benefit, saying "it didn't work" and not showing us what you did never helps. Show us what you did.
if intnx('month',today(),-12,'b')<=variable<=intnx('month',today(),-1,'e') then ...
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.