BookmarkSubscribeRSS Feed
MJM11111
Calcite | Level 5

Hi,

 

I have a rule in SAS VA , that reads data for the current month we are in. what i want to do is create a rule where i don't have to update the 202311 to 202312, the rule should automatically update to the current month we are in and update the figures.  the rule that i am currently using is as follow, but you will notice that month book is 202311- so that means i would have to manually update next month to 202312, what parameters would i use instead of 202311?

IF ( 'Month Booked (yyyy/mm)'n In (202311) )
RETURN 1
ELSE 0

2 REPLIES 2
acordes
Rhodochrosite | Level 12

Try:

 

format(datepart(now()), yym6.)='202312'

 

Look for the format value that returns yyyymm

ThdB
Obsidian | Level 7

Hi,

Try this:

(year(date)<=year(datepart(now()))
if you want to filter for previous years and filter the current year until the current month, you can use:

(year(date) < year(datepart(now())))
or
(Year(date)=year(datepart(now())) and month(date)<=month(datepart(now())))

 

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

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.

Discussion stats
  • 2 replies
  • 575 views
  • 0 likes
  • 3 in conversation