2012-07-16 95 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