Managing Your Data in the SAS Windowing Environment |
Subset Rows of a Table |
In the VIEWTABLE window, you can subset the display to show only those rows that meet one or more conditions. To subset rows of a table, follow these steps:
In the Explorer window, open a library and double-click the table that you want to subset.
In this example, the Furniture sales data table is selected.
Right-click any table cell that is not a heading and select Where from the menu.
The WHERE EXPRESSION window opens.
In the Available Columns list, select a column, and then select an operator from the Operators menu.
In this example, COUNTRY is selected from the Available Columns list, and EQ (equal to) is selected from the Operators menu. Note that the WHERE expression is being built in the Where box at the bottom of the window.
In the Available Columns list, select another value to complete the WHERE expression.
In this example, <LOOKUP distinct values> is selected.
In the Lookup Distinct Values window that appears, select a value.
In this example, Canada is selected.
Note that the complete WHERE expression appears in the Where box at the bottom of the window.
Click OK to close the WHERE EXPRESSION window.
In this example, VIEWTABLE displays only rows where the value of Country is Canada.
Clear the WHERE Expression |
You can clear the WHERE expression that you used to subset your data, and redisplay all of the data in the table. To do this, follow these steps:
Right-click anywhere in the table except in a column heading.
Select WHERE Clear from the pop-up menu.
The VIEWTABLE window removes any existing subsets of data that were created with the WHERE expression, and displays all of the rows of the table.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.