Hi Community,
I would like to use System Date in my Report Parameter. Is there anyway wherein I can fetch system date.
I've aggregated measures which use this "System Date Parameter" for calculation, From System Date I'll be using the Year and Quarter for their calculation.
Regards,
SAS Explorer
Hi
You can get the current date using this expression:
DatePart( Now() )
This is a date that can be formatted in different ways, or used as part of a filter on date items.
Since parameters do not support a date type, you need to format the date as a char, see example below:
Format(DatePart(Now()), 'YYQ6.')
This will return a char string that can then be used as needed.
You might also have a look at this SAS Note entry http://support.sas.com/kb/58/046.html
Bruno
Hi
You can get the current date using this expression:
DatePart( Now() )
This is a date that can be formatted in different ways, or used as part of a filter on date items.
Since parameters do not support a date type, you need to format the date as a char, see example below:
Format(DatePart(Now()), 'YYQ6.')
This will return a char string that can then be used as needed.
You might also have a look at this SAS Note entry http://support.sas.com/kb/58/046.html
Bruno
Hi @BrunoMueller,
I've a tried it and its working. Can you tell me how to convert "year(category)" to year as numeric?
Regards,
SAS Explorer
Hi
Is category a date or a char variable?
The YEAR operator expects to have a date as its argument and will return a numeric.
Bruno
Hi @BrunoMueller,
Its a Date variable, I've done by creating a calculated Item as follows:
TreatAs(_Number_, Year(DatePart(Transaction Date)))
Is there any other method to do it, plz share
Regards,
SAS Explorer
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.