In a SAS Visual Analytics report, you might want to see difference between the values on a range slider and use that value in calculations. To illustrate how this can be done, this sample shows you how to capture the number of days between two dates selected on a range slider. In the following display, there is an interaction from the range slider to the list table and to the speedometer. This means that both objects are updated based on the current selection in the range slider. In this display, the range slider is set from April 11 through April 19. The table and speedometer are updated to display results for those days, and the number of days between April 11 and April 19 (8) is displayed in the Range days
column in the table.
This sample assumes that you have the capabilities and permissions necessary to use SAS® Management Console, the SAS® Visual Analytics Administrator, and SAS Visual Analytics Designer.
This sample also assumes that you know how to register a table in metadata, load a table, and create a report.
The following sample code creates a new table based on SASHELP.CLASS. The new table contains a column named mydate
. If you want to follow along with this sample, you can submit similar code, and then register the classmydate
table in metadata using SAS Management Console.
In the report, you are going to perform these tasks:
Range days
.mydate
data item to the Visual tab, and then drag over the numeric operator TreatAs. Use the default format _Number_. Name the new data item MyDateRaw
..
MyDateRaw
data item to the expression. Name the new data item MyDateMin
.MyDateMax
. Range days
. For this data item, enter the following expression: MyDateMax - MyDateMin
MyDate
as the date. Range days
in the table changes as you adjust the values on the range slider.For more information about SAS Visual Analytics, see the SAS Visual Analytics documentation page.
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.
Type: | Sample |
Date Modified: | 2014-05-02 16:44:02 |
Date Created: | 2014-04-07 17:20:04 |
Product Family | Product | Host | Product Release | SAS Release | ||
Starting | Ending | Starting | Ending | |||
SAS System | SAS Visual Analytics | Linux for x64 | 6.3 | 9.4 TS1M1 | ||
Microsoft® Windows® for x64 | 6.3 | 9.4 TS1M1 |