MDX入门(2)
MDX语言对大小写不敏感,而对于查询轴来说简单有Columns,Rows,Pages,Chapters,Sections分别也可以用AXIS(0),AXIS(1),AXIS(2),AXIS(3),AXIS(4)来表示;
下面来些应用实例:
- SELECT {[Measures].[达标率]} ON COLUMNS, {[科室].[科室名称].[科室名称]} ON ROWS FROM [BI]
- SELECT {[Measures].[达标率]} ON COLUMNS,{[科室].[科室名称].[科室名称]} ON AXIS(1) FROM [BI]
两者显示的效果是一样的;
- SELECT {[Measures].[标准],[Measures].[达标数]} ON COLUMNS,{[年月].[年月名称].&[201502]:[年月].[年月名称].&[201509]} ON AXIS(1)FROM [BI]
逗号表示同维度的成员间隔,而冒号表示同维度的成员区间内的所有元素;
- SELECT {[Measures].[达标率]} ON COLUMNS, {[科室].[科室名称].[科室名称]} ON ROWS FROM [BI]
- SELECT {[Measures].[达标率]} ON COLUMNS,{[科室].[科室名称].MEMBERS} ON AXIS(1)FROM [BI]
两者的区别在于带有MEMBERS的表达式中多了一个汇总ALL的显示,而行轴的另外表达方式[科室].[科室名称].[科室名称]与[科室].[科室名称].CHILDREN是等效的;
- SELECT {[Measures].[达标率]} ON COLUMNS,NON EMPTY{[科室].[科室名称]. CHILDREN} ON AXIS(1)FROM [BI]
NON EMPTY表达式表示去除空切片,将空测量值的成员去除显示;