0

我想做Rolap-cube

创建表后,我使用宏生成在proc olap.

并看到这样的警告和错误:

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 个聚合涵盖了所有可能的去中心化(没有像A B C Dor那样的交叉覆盖去中心化A C D

4

1 回答 1

2

PROC OLAP DATA=选项中,您应该指定多维数据集的数据源

  1. 完整的非规范化表/视图(星型模式事实和维度表的连接)或
  2. 只是事实表(您也可以将其称为FACT=选项以明确)。

在情况 2 中,您还必须DIMENSION ...;在选项中提供(通常是几个)包含对维度表的引用的语句DIMTBL=library.tablname

摘自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)

编辑:

一个维度可以有多个层次结构。它们(它们的列)必须驻留在非规范化基表中或语句DIMTBL=选项中引用的一维表中DIMENSION

因此,如果您使用星型模式构建多维数据集,您应该为每个维度提供一个表和一个事实表。每个维度表都应包含定义一个或多个层次结构所需的所有列。

比如说,在您的情况下, DIMENSION 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)    
    ;
于 2012-07-16T16:06:59.600 回答