In SAS Web Report Studio 4.2 and later, you can use prompted filters that have been created in OLAP-based information maps. This sample explains how to perform the following tasks:
Note: In SAS Web Report Studio, you also can use non-prompted filters that are available in OLAP-based information maps.
As the input table for the cube, this sample uses the SASHELP.PRDSAL2 table. Click the Full Code tab for PROC OLAP code that you can use to build this cube.
Note: An OLAP filter is applied only to the members of the cube that are available via the selected category data item. Before generating the result set for a query, the cube’s measures are reaggregated based on that subset of members.
Here is what your prompt might look like at this point:
Note: On this tab, the values for Method for populating prompt and Data source are preset.
Here is what your prompt might look like at this point:
The prompt window will look similar to this, with the default value (if you specified one) selected. The display text appears above the prompt box.
For this sample, CHAIR is selected as the prompt value. Click View Report to see the following results.
For more information about SAS Web Report Studio, see the SAS Web Report Studio documentation page.
For more information about SAS Information Map Studio, see the SAS Information Map Studio documentation page.
For more information about PROC OLAP, see The OLAP Procedure.
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.
Before submitting this code, these tasks must be done:
Note: For information about registering libraries and tables, see Establishing Connectivity to a Library of SAS Data Sets.
LIBNAME sashelp BASE "your-sas-path\core\sashelp" ;
PROC OLAP
Data=sashelp.PRDSAL2
DrillThrough_Table=sashelp.PRDSAL2
cube=PRDSAL2
Path="your-path"
Workpath="your-path"
Description="PRDSAL2"
;
METASVR host="your-host-name" port=8561 protocol=bridge userid="your-userid"
pw="your-password"
repository="Foundation"
olap_schema="SASApp - OLAP Schema";
DIMENSION Prod hierarchies=(Prod )
CAPTION='Product Dimension'
SORT_ORDER=ASCENDING ;
HIERARCHY Prod ALL_MEMBER='All Prod'
levels=( PRODTYPE PRODUCT )
CAPTION='Product Hier'
DEFAULT
;
LEVEL PRODUCT
CAPTION='Product'
SORT_ORDER=ASCENDING
;
LEVEL PRODTYPE
CAPTION='Product Type'
SORT_ORDER=ASCENDING
;
DIMENSION Geo hierarchies=(Geo )
CAPTION='Geo'
TYPE=GEO SORT_ORDER=ASCENDING ;
HIERARCHY Geo ALL_MEMBER='All Geo'
levels=( COUNTRY COUNTY STATE )
CAPTION='Geo'
DEFAULT
;
LEVEL STATE
CAPTION='State/Province'
SORT_ORDER=ASCENDING
;
LEVEL COUNTY
CAPTION='County'
SORT_ORDER=ASCENDING
;
LEVEL COUNTRY
CAPTION='Country'
SORT_ORDER=ASCENDING
;
DIMENSION Time hierarchies=(Time )
CAPTION='Time'
TYPE=TIME SORT_ORDER=ASCENDING ;
HIERARCHY Time ALL_MEMBER='All Time'
levels=( YEAR QUARTER MONTH )
CAPTION='Time'
DEFAULT
;
LEVEL MONTH
CAPTION='Month'
SORT_ORDER=ASCENDING
;
LEVEL QUARTER
CAPTION='Quarter'
SORT_ORDER=ASCENDING
;
LEVEL YEAR
CAPTION='Year'
SORT_ORDER=ASCENDING
;
MEASURE PREDICTAVG
STAT=AVG
COLUMN=PREDICT
CAPTION='Average PREDICT'
FORMAT=DOLLAR12.2
DEFAULT
;
MEASURE ACTUALAVG
STAT=AVG
COLUMN=ACTUAL
CAPTION='Average ACTUAL'
FORMAT=DOLLAR12.2
;
MEASURE ACTUALSUM
STAT=SUM
COLUMN=ACTUAL
CAPTION='Sum of ACTUAL'
FORMAT=DOLLAR12.2
;
MEASURE PREDICTSUM
STAT=SUM
COLUMN=PREDICT
CAPTION='Sum of PREDICT'
FORMAT=DOLLAR12.2
;
AGGREGATION PRODUCT
PRODTYPE
STATE
COUNTY
COUNTRY
MONTH
QUARTER
YEAR
/ NAME='DEFAULT'
;
FORMAT PRODUCT $CHAR10.;
FORMAT PRODTYPE $CHAR10.;
FORMAT STATE $CHAR22.;
FORMAT COUNTY $CHAR20.;
FORMAT COUNTRY $CHAR10.;
FORMAT MONTH MONNAME3.;
FORMAT QUARTER 8.;
FORMAT YEAR 4.;
RUN;
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 |
Topic: | Data Management ==> Data Sources ==> Cubes Query and Reporting ==> OLAP (Online Analytical Processing) Query and Reporting |
Date Modified: | 2010-06-03 12:31:59 |
Date Created: | 2010-06-03 10:15:13 |
Product Family | Product | Host | Product Release | SAS Release | ||
Starting | Ending | Starting | Ending | |||
SAS System | SAS Information Map Studio | Windows Vista for x64 | 4.2 | 9.2 TS2M0 | ||
Windows Vista | 4.2 | 9.2 TS2M0 | ||||
Microsoft Windows XP Professional | 4.2 | 9.2 TS2M0 | ||||
Microsoft Windows Server 2008 for x64 | 4.2 | 9.2 TS2M0 | ||||
Microsoft Windows Server 2003 for x64 | 4.2 | 9.2 TS2M0 | ||||
Microsoft Windows Server 2003 Standard Edition | 4.2 | 9.2 TS2M0 | ||||
Microsoft Windows Server 2003 Enterprise Edition | 4.2 | 9.2 TS2M0 | ||||
Microsoft Windows Server 2003 Datacenter Edition | 4.2 | 9.2 TS2M0 | ||||
Microsoft® Windows® for x64 | 4.2 | 9.2 TS2M0 |