01-27-2015 01:31 AM
I want to calculate how many days remaining in this month, for example i have date field with last updated date (20th Jan, 2014), i want to find out remaining days in this month (Jan). is there any way to do this.
01-27-2015 09:30 AM
Dates in SAS are stored as numbers.
For your problem, you can create a new column defined as "'31JAN2015'd - datevariable" which gives you the days remaining in this month, provided datevariable is in numerical or date format.
01-27-2015 01:50 PM
dates are represented in a date format but at the end they are just a number.
So you can decide for yourselves if you want a date format or transform the date to a number
and use a numeric format. (Using a new calculated field)
question is, what is your goal to reach using the available tools.
hope this helps a little.
01-27-2015 09:28 PM
It may be best to do the processing prior to loading the data into SAS Visual Analytics if you want to use the intnx function. As you can see in the screenshot this function is not available within the Calculated Data Item expression builder
As suggests you could convert the data item to its number and do a numeric calculation. Note if you import the data from Excel it uses the Excel format type to determine its metadata type in SAS Visual Analytics.
Alternatively, you could use SAS Visual Analytics Data Builder to create a query to create an expression for your new Days column as the intnx function is available there as per the screenshot below
01-28-2015 01:29 AM
Hi All, Thanks for your valuable suggestions,
Hi Michelle, Present don't have permission to access data query builder, i have permission to access only Reports, is there any way to this in reports (Version 6.4). Every Month i am creating manually new date variable 'Month end' (31st Jan 2015), and then i will convert the two date variables'MAX DATE' (20th JAN 2015), 'MONTH END'(31st JAN 2015) into numeric using treatas function, after that i will subtract the two numeric dates then i can easily get answer changing Aggregation to MAX in Properties Tab. but my problem is every month it will be automated, is there any way to do this in reports environment.
01-28-2015 08:35 PM
I would want to automate the process too... Having access to the SAS Visual Analytics Data Builder will enable you to have a scheduled query that creates these columns and update your table. Alternatively, you could have a scheduled SAS process outside of the SAS Visual Analytics environment prior to the data load process.