BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SAS_Explorer
Obsidian | Level 7

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

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

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

View solution in original post

5 REPLIES 5
pearsoninst
Pyrite | Level 9
You can use the SYSDATE it is an AMV
BrunoMueller
SAS Super FREQ

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

SAS_Explorer
Obsidian | Level 7

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

BrunoMueller
SAS Super FREQ

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

SAS_Explorer
Obsidian | Level 7

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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 2003 views
  • 0 likes
  • 3 in conversation