Exploring, modeling, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

Using System Date as Parameter

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 16
Accepted Solution

Using System Date as Parameter

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


Accepted Solutions
Solution
‎05-12-2016 12:53 AM
SAS Super FREQ
Posts: 676

Re: Using System Date as Parameter

[ Edited ]

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


All Replies
Frequent Contributor
Posts: 108

Re: Using System Date as Parameter

You can use the SYSDATE it is an AMV
Solution
‎05-12-2016 12:53 AM
SAS Super FREQ
Posts: 676

Re: Using System Date as Parameter

[ Edited ]

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

Occasional Contributor
Posts: 16

Re: Using System Date as Parameter

Hi @Bruno_SAS,

 

I've a tried it and its working. Can you tell me how to convert "year(category)" to year as numeric?

 

Regards,

SAS Explorer

SAS Super FREQ
Posts: 676

Re: Using System Date as Parameter

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

Occasional Contributor
Posts: 16

Re: Using System Date as Parameter

Hi @Bruno_SAS,

 

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

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 397 views
  • 0 likes
  • 3 in conversation