2012-07-16 154 views
0

我想製作Rolap-cubeSAS:Proc Olap。非聚合聚合

在創建表之後,我使用宏生成在proc olap中編寫Aggregation語句。

而且看到警告和錯誤是這樣的:

WARNING: You cannot use NAME "DEFAULT" in the AGGREGATION statement for a non-NWAY aggregation. 
NOTE: The aggregation name "DEFAULT" was changed to "AGGR1". 

ERROR: An input data set was not specified. 

有什麼不對? (我不特定的數據集,因爲我有表的大數目,我想在Rolap-cube使用)

增加: 如果我有這樣的尺寸:

DIMENSION MyDim hierarchies=(First Second) 

HIERARCHY First 
    levels=(A B D) 
    DEFAULT 
    ; 
HIERARCHY Second 
    levels=(C D)  
    ; 

D是最小的水平,它有兩個層次:D belond to B belong to AD belong to C

如果我指定與水平彙總表:
1)A B D
2)A B
3)A
4)C D
5)C
6)none

然後SAS對我說,我不指定輸入數據集。 (聚合表之一)。

但是這6個聚集涵蓋所有可能的detalizations(沒有交叉覆蓋detalization像A B C DA C D

+0

你肯定必須指定(一個)輸入數據集 - 表或視圖 – vasja 2012-07-16 13:42:02

+0

如何確定,哪一個? (如果我有一些層次結構) – gaussblurinc 2012-07-16 13:53:25

回答

2

PROC OLAP DATA=選項,你應該爲立方體

  1. 要麼全非規範化的指定數據源表格/視圖(星圖模式事實和 尺寸表的連接)或
  2. 只是事實表(您也可以參考它作爲FACT=選項清除)。

在情況2中,還必須提供(通常是幾個)包含參照維度表中DIMTBL=library.tablname選項DIMENSION ...;語句。從http://support.sas.com/documentation/cdl/en/olapug/59574/HTML/default/viewer.htm#a002605625.htm

> DATA | FACT=dsname 
> 
>  specifies the data source for the cube. The unsummarized data source can be any SAS data file, including files that are supported by 
> SAS/ACCESS software engines. If you load the cube from a star schema, 
> then the dsname is the name of the fact table that contains the 
> analysis variables from which to derive the measures for the cube. The 
> fact table must also contain fact keys that correspond to dimension 
> tables in the star schema. 
> 
>  You can also provide data set options along with DATA | FACT=. Options are stored within the cube and reapplied when the data is 
> accessed at run time. For more information, see "Data Set Options" in 
> SAS Language Reference: Concepts. 
> 
>  Note: This option is not required if you want to define the cube by using input data from a fully summarized external data source (a 
> crossing of all dimensions known as an NWAY). In that case, you 
> specify the data source for the cube by using the TABLE= option in the 
> AGGREGATION statement. [cautionend] 
>  Interaction: If you load the cube from a star schema, then you must use the DIMENSION statement to do the following: 
> 
>   specify the dimension table name (the DIMTBL= option) 
> 
>   specify the dimension (primary) key column (the DIMKEY= option) 
> 
>   specify the column (foreign key) in the fact table that corresponds to the dimension key column (the FACTKEY= option) 

編輯

摘錄:

可以有多個層次結構的一個維。他們(他們的專欄)必須駐留在非規格化的基本表格或DIMENSION語句中DIMTBL=選項中引用的一個維表中。

因此,如果您使用星型模式構建多維數據集,則每個維度和一個事實表應該有一個表。 每個維度表應包含定義一個或多個層次結構所需的所有列。

萊斯的說,在你的情況下,尺寸MyDim被包含在庫MyLib中表MyDim - 相關語句應該是:

DIMENSION MyDim hierarchies=(First Second) 
    DIMKEY=D 
    DIMTBL=MyLib.MyDim 
    ; 

HIERARCHY First 
    levels=(A B D) 
    DEFAULT 
    ; 
HIERARCHY Second 
    levels=(C D)  
    ; 
+0

好的,但我想了解,會發生什麼,如果我有兩個層次像在我的問題(現在編輯) – gaussblurinc 2012-07-17 08:42:48