MDX语言中的Filter
2010-08-19 20:37
302 查看
<Dimension foreignKey="EMPLOYEE_ID" name="Employee">
<Hierarchy hasAll="true" primaryKey="EMPLOYEE_ID">
<Table name="TB_EMPLOYEE" schema="MYORACLE">
</Table>
<Level name="employeeId" column="EMPLOYEE_ID"
nameColumn="EMPLOYEE_NAME" type="String" uniqueMembers="true" levelType="Regular"
hideMemberIf="Never">
<Property name="IsNew" column="EMPLOYEE_NEW"
type="Numeric">
</Property>
</Level>
</Hierarchy>
</Dimension>
前面是一个Employee维度的定义(后面还会用到Measure Salary,就是薪水这个Measure,定义就不在这里贴出来了),注意里面有IsNew属性的定义,IsNew有两个值,0和1。现在我需要通过IsNew来进行自定义显示,需要的时候显示0,或1或0,1。
MDX查询
(1)显示IsNew属性值 大于等于0 的[Employee]成员
select Measures.Salary on columns,
filter( { [Employee].[All Employees].Children } , [Employee].CurrentMember.Properties("IsNew") >= 0 ) on rows from Cube
结果:
Axis #0:
{}
Axis #1:
{[Measures].[Salary]}
Axis #2:
{[Employee].[All Employees].[张三]}
{[Employee].[All Employees].[李四]}
{[Employee].[All Employees].[王五]}
Row #0: 3,300
Row #1: 1,500
Row #2: 6,000
(2)显示IsNew属性值等于0的[Employee]成员
select Measures.Salary on columns,
filter( { [Employee].[All Employees].Children } , [Employee].CurrentMember.Properties("IsNew") = 0 ) on rows from Cube
结果:
Axis #0:
{}
Axis #1:
{[Measures].[Salary]}
Axis #2:
{[Employee].[All Employees].[张三]}
{[Employee].[All Employees].[李四]}
Row #0: 3,300
Row #1: 1,500
<Hierarchy hasAll="true" primaryKey="EMPLOYEE_ID">
<Table name="TB_EMPLOYEE" schema="MYORACLE">
</Table>
<Level name="employeeId" column="EMPLOYEE_ID"
nameColumn="EMPLOYEE_NAME" type="String" uniqueMembers="true" levelType="Regular"
hideMemberIf="Never">
<Property name="IsNew" column="EMPLOYEE_NEW"
type="Numeric">
</Property>
</Level>
</Hierarchy>
</Dimension>
前面是一个Employee维度的定义(后面还会用到Measure Salary,就是薪水这个Measure,定义就不在这里贴出来了),注意里面有IsNew属性的定义,IsNew有两个值,0和1。现在我需要通过IsNew来进行自定义显示,需要的时候显示0,或1或0,1。
MDX查询
(1)显示IsNew属性值 大于等于0 的[Employee]成员
select Measures.Salary on columns,
filter( { [Employee].[All Employees].Children } , [Employee].CurrentMember.Properties("IsNew") >= 0 ) on rows from Cube
结果:
Axis #0:
{}
Axis #1:
{[Measures].[Salary]}
Axis #2:
{[Employee].[All Employees].[张三]}
{[Employee].[All Employees].[李四]}
{[Employee].[All Employees].[王五]}
Row #0: 3,300
Row #1: 1,500
Row #2: 6,000
(2)显示IsNew属性值等于0的[Employee]成员
select Measures.Salary on columns,
filter( { [Employee].[All Employees].Children } , [Employee].CurrentMember.Properties("IsNew") = 0 ) on rows from Cube
结果:
Axis #0:
{}
Axis #1:
{[Measures].[Salary]}
Axis #2:
{[Employee].[All Employees].[张三]}
{[Employee].[All Employees].[李四]}
Row #0: 3,300
Row #1: 1,500
相关文章推荐
- MDX FILTER的问题
- MDX FILTER
- MDX语法学习(一)filter与iif的使用
- Mondrian>>MDX语法学习--filter与iif的使用
- MDX语法学习--filter与iif的使用
- SSAS中MDX语言之二
- MDX语法学习(一)filter与iif的使用
- mdx 根据维度Hierarchy节点的名字来filter节点,搜索节点
- mdx 根据维度Hierarchy节点的名字来filter节点,搜索节点
- [分享]微软BI专题-BI中的特殊语言——MDX(下)
- 【语言工具】Python闭包,装饰器,生成器,偏函数,函数式编程,lamda,map,reduce,filter
- MDX Cookbook 04 - 在集合中实现 NOT IN 逻辑 (Minus, Except, Filter 等符号和函数的使用)
- 【转】多维数据查询OLAP及MDX语言笔记整理
- Haskell语言学习笔记(3)map, filter, fold
- 巧用Reponse.Filter实现多语言功能
- BI中的特殊语言——MDX
- 多维数据查询OLAP及MDX语言学习整理
- MDX Cookbook 05 - 条件过滤 FILTER-COUNT 与 SUM-IIF 实现
- 巧用Reponse.Filter实现多语言功能
- 【转】巧用 Reponse.Filter实现多语言功能