Creating Cube

Embed Size (px)

Citation preview

  • 8/8/2019 Creating Cube

    1/21

    Defining A Connection Profile

    Each time you log onto SAS OLAP Cube Studio, a connection is made to a metadata server.Before you can build a cube in SAS OLAP Cube Studio, you must specify a connection profile

    that contains the information for the metadata server that you want to build your cube with. In

    SAS OLAP Cube Studio, select File Connection Profile. On the Open a Connection Profiledialog box, you can choose to either create a new connection profile or edit an existing one. Ifyou choose to create a new connection profile, the Connection Profile wizard will open. The

    following display shows the information that is entered for a connection profile.

    Enter the machine information for the metadata server that you will connect to and retrieve a data

    source from.

    y In the New Connection Profile dialog box, enter the machine ID, port, your user ID, andpassword.

    Building a Cube from a Detail Table

    A detail, or base, table is a table whose data pertains to a single area of interest. It is any table

    defined in a SAS Metadata Repository that contains the measures and levels for a cube. You canbuild an OLAP cube from a detail table by using the Cube Designer wizard in SAS OLAP Cube

    Studio. In this example, you use data from a recent product marketing campaign. You establish

  • 8/8/2019 Creating Cube

    2/21

    measures and summaries of various aspects of the data, such as product statistics, geographiclocation of potential customers, and revenue summaries.

    Enter General Cube Information

    After you have established a connection profile, you can begin to create a cube. Select FileNew Cube. On the Cube Designer - General page, enter the basic cube information. For this

    example input type, you select Detail Table. The following display shows fields that you enter

    information for.

    y Enter information in the following fields:o Nameo Descriptiono OLAP schemao Location (SAS folder)o Physical cube path (path in the file system to store the cube)o Work path (path for temporary work files)o Input Type (detail table)

  • 8/8/2019 Creating Cube

    3/21

    Select A Detail Table

    At the Cube Designer - Input page, select a detail table for your cube. If one does not exist for

    your data, select Define Table, and then define the source that you will import your metadata

    from. The following display shows the input table Detail that is selected for the example cube.

    Drill-Through Table

    At the Cube Designer - Drill-Through dialog box, you can select or define an optional drill-

    through table. Drill-through tables can be used by client applications to provide a view from

    processed data into the underlying data source.

    If a drill-through table does not exist for your data, select Define Table, and then define the

    source that you will import your metadata from.

    Table Options

    The Table Options button is available in both the Cube Designer - Input and the Cube Designer -Drill-Through dialog boxes. It opens the Table Options dialog box. It enables you to specify data

  • 8/8/2019 Creating Cube

    4/21

    set options that are used to open the data set. For example, you could enter aWHERE clause orsubsetting information that is then applied to the selected table when it is opened. The options

    are stored as part of the cube and then reapplied when the data is accessed at run time. You canalso specify data set options in the Dimension Designer - General dialog box (for use with star

    schemas) and the Stored Aggregates dialog box (for use with summarized tables). For more

    information, see "Data Set Options" in SAS Language Reference: Concepts.

    Define Dimensions, Levels, and Hierarchies

    Now that your basic metadata server and cube information has been entered, you can define the

    different dimensions and their respective levels and hierarchies. For this example, the following

    dimensions are created:

    y Productsy

    Datesy Geographyy Customersy Orders

    At the Cube Designer - Dimensions page, select Add.

  • 8/8/2019 Creating Cube

    5/21

    This opens the Dimension Designer - General page, as seen in the following display.

    Enter the information in the following fields:

    y Namey Captiony Descriptiony Type (Standard, GEO, or TIME)y Sort Order.

    Select Next. This opens the Dimension Designer - Level page. Next, select Add to open the AddLevels page, as seen in the following display.

  • 8/8/2019 Creating Cube

    6/21

    Select the levels you want to add to the dimension. Select OK to return to the Dimension Designer -

    Level page, where the selected levels are listed. You can now define properties such as format, time

    type, and sort order for the levels that you have selected. See the following display.

  • 8/8/2019 Creating Cube

    7/21

    Next, define hierarchies for the levels on the Dimension Designer - Hierarchy page. You can select Add to

    open the Define a Hierarchy page and individually select the levels for the hierarchy.

    Or you can select Finish on the Dimension Designer - Hierarchy page to accept the order of the levels

    that are defined on the previous Dimension Designer - Level page. If you select this option, the hierarchyis assigned the same name as the dimension. See the following display.

  • 8/8/2019 Creating Cube

    8/21

    Repeat this process for each dimension. After you create each dimension, it is listed in the Dimensions

    panel of the Cube Designer - Dimensions page. See the following display.

    Creating a Time Dimension

    When you create the Dates dimension, you must specify the TIME dimension type on the

    Dimension Designer - General page. See the following display.

  • 8/8/2019 Creating Cube

    9/21

    Specifying the TIME dimension type enables Add supplied time hierarchies on the Dimension Designer -Level page. The Add button is converted to a drop-down list of options. The Add levels and Add supplied

    time hierarchies options are now available for selection. See the following displays.

  • 8/8/2019 Creating Cube

    10/21

    This display shows the Add button when selected.

    Select Add supplied time hierarchies. This opens the Add Supplied dialog box. Select from the list of supplied time

    hierarchies to create the time levels. This also creates the hierarchies for the dimension. See the following display.

  • 8/8/2019 Creating Cube

    11/21

    You can then define properties such as time type and sort order for the levels that you have selected. See the

    following display.

  • 8/8/2019 Creating Cube

    12/21

    The hierarchy or hierarchies that are selected on the Add Supplied - dialog box are listed in the Hierarchies panel

    on the Dimension Designer - Hierarchy page. If there is only one hierarchy, as with this example, the hierarchyname is changed to match the dimension name. See the following display.

  • 8/8/2019 Creating Cube

    13/21

    Define Measures

    You can now define the measures for the cube. In this example, you define measures for theCostPrice Per Unit. Define the measures for the cube at the Cube Designer - Select Measurespage, as shown in the following display.

  • 8/8/2019 Creating Cube

    14/21

    Modify any measure attributes such as measure captions and formats at the Cube Designer - Measure Detailspage, as shown in the following display.

  • 8/8/2019 Creating Cube

    15/21

    Define Member Properties

    You can now define the member properties for any needed cube members. A member property is

    an attribute of a dimension member. A member property is also an optional cube feature that is

    created in a dimension to provide users with additional information about members. For thisexample, you can define the customer gender as a member property. Define member properties

    in the Cube Designer - Member Property dialog box, as seen in the following display.

  • 8/8/2019 Creating Cube

    16/21

    At the Define a Member Property page, enter the member property name, level, column, format, and caption.

  • 8/8/2019 Creating Cube

    17/21

    Define Aggregations

    You can now define the aggregations for the cube. Aggregations are summaries of detailed data

    that are stored with a cube or referred to by a cube. They can help contribute to faster queryresponse. Define the aggregations for the cube from the Cube Designer - Aggregations page, as

    shown in the following display.

  • 8/8/2019 Creating Cube

    18/21

    Select Add to specify a user-defined aggregation. This opens the Add Aggregation dialog box, as shown in the

    following display. In this dialog box you can select levels to add to the aggregation that you are defining.

  • 8/8/2019 Creating Cube

    19/21

    Select OK to return to the Cube Designer - Aggregations page, where the new aggregation is listed. SelectNext to

    go to the Cube Designer - Finish page.

    Build the Cube

    You can now build the cube. On the Cube Designer - Finish page, review the settings for thecube, and then select one of the cube creation options, as shown in the following display.

    You can choose to do one of the following:

    1. save the metadata and create the cube2. save the metadata but do not create the cube

    You can also select whether to save the generated PROC OLAP code. Select Export Code. Thisopens the Export Code dialog box, as shown in the following display.

  • 8/8/2019 Creating Cube

    20/21

    You can select to save either the long or short form of the code, or both. Enter the file location(s)

    where you want to save the resulting code. Select OK when finished to return to the CubeDesigner - Finish page.

    On the Cube Designer - Finish page, select Finish to complete the wizard. If the cube builds

    successfully, you will receive progress messages about the cube build, as seen in the followingdisplay.

    Save a Cube's PROC OLAP Code

    In SAS OLAP Cube Studio, you can elect to save the PROC OLAP code that is generated when

    a cube is built. The code is saved to a text file that you specify. The information saved in the fileincludes the following items:

    ythe SAS LIBNAME statement

    y any FMTSEARCH statementsy any additional SAS codey the PROC OLAP statementy the METASVR statementy all other PROC OLAP statements

    You can access the Save PROC OLAP Code dialog box by using one of the following methods:

  • 8/8/2019 Creating Cube

    21/21

    1. On the tree view in SAS OLAP Cube Studio, right-click on a cube and select ExportCode.

    2. In the Cube Designer - Finish page in the Cube Designer wizard, right-click Export Code.The Export Code dialog box opens. You can select to save either the long or short form of the

    code, or both. Enter the file location or locations where you want to save the resulting code.Select OK when finished.