member Attribute 用法

成员属性的概念

将维度属性的AttributeHierarchyEnabled设置为False,那么这个属性就是成员属性,成员属性不会创建属性层次结构,但是能为其他叶级成员提供额外的信息。

AttributeHierarchyEnabled 属性的值确定是否创建属性层次结构。如果将该属性设置为 False,则不创建属性层次结构,并且无法将该属性用作用户层次结构中的一个级别;该属性层次结构只作为成员属性存在。

1示例,将DimProduct的Color属性的AttributeHierarchyEnabled设置为False,使Color作为成员属性。

创建一个用户定义的层次结构Product Hierarchy,按照提示将ProductKey,ProductSubcategoryKey和ProductCategoryKey的AttributeHierarchyVisible设置为False,使这三个属性的属性层次结构不显示出来,以便使User产生混乱。

2 在Browser选项卡中,在Hierarchy列表中没有Color ,也没有AttributeHierarchyVisible为False的属性层次结构。

如果尝试添加一个禁用的属性层次结构作为用户层次结构的一个级别,那么您将收到错误消息,通知您必须启用该属性层次结构才能参与用户定义层次结构。

3 成员属性为其他成员提供额外的信息

成员属性作为附加信息:一个维度属性不需要直接显示给最终的用户,不需要做数据聚合等,仅仅作为查询的数据单元的附加信息。

既然在DimProduct的Browser中查看不到Color的信息,那么color如何提供额外的信息了?必须在Excel的PivotTable中进行查看,才能看到成员属性的额外信息。

由于成员属性提供的是叶级成员的额外信息,必须下钻到叶级成员才能查看,共有两种方式

3.1 选中一个叶级成员,鼠标悬浮在其上方,Excel会显示出成员属性Color的值

3.2 选中一个叶级成员,点击右键快捷菜单,Show Properties In Report --》Color,PivotTable会增加一列Color。

4 成员属性的值,如何通过MDX来查询

4.1 通过dimension properties语句来查询,这体现了MDX能查询更多的MetaData的优势。

select [Measures].[Unit Cost] on columns,
    [Dim Product].[Product Hierarchy].Members
        dimension properties [Dim Product].[Product Hierarchy].[Product Key].Color on rows
from [Adventure Works DW2012]

查询结果如下

从左边列种选中一个叶级节点,双击点卡Member Properties对话框,查看成员的属性,最后一个是Color

4.2 通过Properties函数来查看

with member [Measures].Color
as [Dim Product].[Product Hierarchy].CurrentMember.Properties("Color")
select [Measures].Color on columns,
    [Dim Product].[Product Hierarchy].Members on rows
from [Adventure Works DW2012]

5,MSDN上对成员属性的介绍


You can retrieve user-defined member properties using either the PROPERTIES keyword or the Properties function.

Using the PROPERTIES Keyword to Retrieve User-Defined Member Properties

The syntax that retrieves user-defined member properties is similar to that used to retrieve intrinsic level member properties, as shown in the following syntax:

DIMENSION PROPERTIES [Dimension.]Level.<Custom_Member_Property>

The PROPERTIES keyword appears after the set expression of the axis specification. For example, the following MDX query the PROPERTIES keyword retrieves the List Price and Dealer Price user-defined member properties and appears after the set expression that identifies the products sold in January:

SELECT
   CROSSJOIN([Ship Date].[Calendar].[Calendar Year].Members,
             [Measures].[Sales Amount]) ON COLUMNS,
   NON EMPTY Product.Product.MEMBERS
   DIMENSION PROPERTIES
              Product.Product.[List Price],
              Product.Product.[Dealer Price]  ON ROWS
FROM [Adventure Works]
WHERE ([Date].[Month of Year].[January])

Using the Properties Function to Retrieve User-Defined Member Properties

Alternatively, you can access custom member properties with the Properties function. For example, the following MDX query uses the WITH keyword to create a calculated member consisting of the List Price member property:

WITH
   MEMBER [Measures].[Product List Price] AS
   [Product].[Product].CurrentMember.Properties("List Price")
SELECT
   [Measures].[Product List Price] on COLUMNS,
   [Product].[Product].MEMBERS  ON Rows
FROM [Adventure Works]
时间: 2024-08-29 04:15:49

member Attribute 用法的相关文章

attribute用法

attribute 用法 摘要: 在学习linux内核代码及一些开源软件的源码(如:DirectFB),经常可以看到有关__attribute__的相关使用.本文结合自己的学习经历,较为详细的介绍了__attribute__相关语法及其使用. ---------------------------------------------------------------- 声明: 此文为原创,欢迎转载,转载请保留如下信息 作者:聂飞(afreez) 北京-中关村 联系方式:[email prote

C之attribute用法

转自:http://www.cnblogs.com/astwish/p/3460618.html GNU C 的一大特色就是__attribute__ 机制.__attribute__ 可以设置函数属性(Function Attribute ).变量属性(Variable Attribute )和类型属性(Type Attribute ). __attribute__ 书写特征是:__attribute__ 前后都有两个下划线,并切后面会紧跟一对原括弧,括弧里面是相应的__attribute__

C#属性(Attribute)用法实例解析

属性(Attribute)是C#程序设计中非常重要的一个技术,应用范围广泛,用法灵活多变.本文就以实例形式分析了C#中属性的应用.具体入戏: 一.运用范围 程序集,模块,类型(类,结构,枚举,接口,委托),字段,方法(含构造),方法,参数,方法返回值,属性(property),Attribute [AttributeUsage(AttributeTargets.All)] public class TestAttribute : Attribute { } [TestAttribute]//结构

C#教程之C#属性(Attribute)用法实例解析

引用:https://www.xin3721.com/ArticlecSharp/c11686.html 属性(Attribute)是C#程序设计中非常重要的一个技术,应用范围广泛,用法灵活多变.本文就以实例形式分析了C#中属性的应用.具体入戏: 一.运用范围 程序集,模块,类型(类,结构,枚举,接口,委托),字段,方法(含构造),方法,参数,方法返回值,属性(property),Attribute [AttributeUsage(AttributeTargets.All)] public cl

从list中查找子list

member函数用法很奇怪,用一个元素到list中查找,如果找到,则将找到的元素和之后所有元素变成一个新的list返回,如果找不到则返回nil. (set 'aList '(a b c d e f g h)) → (a b c d e f g h) (member 'd aList) → (d e f g h) (member 55 aList) → nil

流行的JavaScript库 ——jQuery

1.为了简化 JavaScript 的开发, 一些 JavsScript 库诞生了. JavaScript 库封装了很多预定义的对象和实用函数.能帮助使用者建立有高难度交互的 Web2.0 特性的富客户端页面, 并且兼容各大浏览器.当前流行的 JavaScript 库有:jQuery, MooTools, Prototype, Dojo, YUI, EXT_JS  DWR 2.jQuery由美国人John Resig创建,至今已吸引了来自世界各地的众多javascript高手加入其team. j

JQuery技术详解

前面我们讲解了的J2EE的技术都是服务端的技术,下面我们来看一下前端的一些开发技术,这一篇我们来看一下jQuery技术 简介: jQuery由美国人John Resig创建,至今已吸引了来自世界各地的众多 javascript高手加入其team.jQuery是继prototype之后又一个优秀的Javascript框架.其宗旨是——WRITE LESS,DO MORE,写更少的代码,做更多的事情.它是轻量级的js库(压缩后只有21k) ,这是其它的js库所不及的,它兼容CSS3,还兼容各种浏览器

[转]详解C#组件开发的来龙去脉

C#组件开发首先要了解组件的功能,以及组件为什么会存在.在Visual Studio .NET环境下,将会有新形式的C#组件开发. 组件的功能 微软即将发布的 Visual Studio .NET 将使程序开发人员获得一个集成开发环境,它不但为开发传统的 C/C++ 应用程序,而且也为令人振奋的Microsoft .NET 组件提供了丰富的工具.这些以管理代码编写.在通用语言运行时构建的组件向开发人员提供了一个全新的混合开发环境,即象 Microsoft Visual Basic 一样容易,而同

JQuery中常用的选择器

属性选择器 1>  [attribute] 概述:匹配包含给定属性的元素. 示例 jQuery 代码:$("div[id]") 描述:查找所有含有 id 属性的 div 元素 2>  [attribute=value] 概述:匹配给定的属性是某个特定值的元素 3> [attribute!=value] 概述:匹配所有不含有指定的属性,或者属性不等于特定值的元素. 4> [attribute^=value] 概述:匹配给定的属性是以某些值开始的元素 5> [