Sample 58046: Creating a rolling 12-month expression in SAS® Visual Analytics
It is not uncommon to want to view a year's worth of data. It is also not uncommon to want a rolling 12-month view of data where the data is automatically updated based on the current date. This is possible in SAS® Visual Analytics Designer by creating a data source filter.
To create the filter, select New Data Source Filter from the Options menu on the Data tab. The syntax for a rolling 12-month view would look similar to this:
( TreatAs(_Number_, 'Date'n) BetweenInclusive(( ( TreatAs(_Number_, DatePart(Now())) - 365 )
- TreatAs(_Number_, DayOfMonth(DatePart(Now()))) ), ( TreatAs(_Number_, DatePart(Now()))
- TreatAs(_Number_, DayOfMonth(DatePart(Now()))) )) )
On the Visual tab, this expression would look like this:
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Date Modified: | 2016-04-18 15:27:11 |
Date Created: | 2016-04-13 10:20:28 |
Operating System and Release Information
SAS System | SAS Visual Analytics | Microsoft® Windows® for x64 | 7.1 | | 9.4 TS1M2 | |
Linux for x64 | 7.1 | | 9.4 TS1M2 | |