Anchky's Tech Blog
专注.NET 专注BI
尽最大的努力,以求更好!

        字符串函数

函数

描述

CalculationPassValue

返回在多维数据集的指定计算传递上对 MDX 表达式求得的值。

 

with member measures.test as 'CalculationPassValue(membertostr([sales average])  , -1, RELATIVE)'

select  {measures.test, [sales average] } on columns,   { [Time].allmembers} on rows

from Sales

上面的语句按理是对的,但不能运行!待改!

CoalesceEmpty

将空单元值合并为字符串或数字。

 

with member measures.test as 'CoalesceEmpty(Time.currentmember.Parent.Name, "EMPTY")'

select  {measures.test  } on columns,   {time.allmembers} on rows

from Sales

能运行但不是预想效果

Generate

返回通过在集合上对字符串表达式计算而创建的连锁字符串。

 

看上面的

IIf

返回由逻辑测试确定的两个字符串或数值之一。

 

with member measures.test as 'iif (isempty(Time.currentmember.Parent )   , "EMPTY","exist")'

select  {measures.test  } on columns,   {time.allmembers} on rows

from Sales

LookupCube

返回在同一数据库中另外一个指定的多维数据集上对 MDX 表达式求得的值。

 

看上面的

MemberToStr

从某个成员构造一个字符串。

 

with member measures.test as ' MemberToStr([store Sales]) '

select  {measures.test } on columns,

  { [Time].allmembers} on rows

from Sales

Name

返回维度、层次结构、级别或成员的名称。

 

Properties

返回包含成员属性值的字符串。

 

with member measures.test as 'store.currentmember.Properties("Store Manager") '

select  {measures.test } on columns,

  { Descendants([Store].[All Stores].[USA],[Store].[Store Name])} on rows from Sales

SetToStr

用集合构造一个字符串。

 

select  {measures.[store sales] } on columns,

  { strtoset(SetToStr({[Time].[1997], [Time].[1998]}))} on rows

from Sales

TupleToStr

用元组构造一个字符串。

 

with member [measures].[TupleToStr] as 'TupleToStr(([Measures].[Sales Count], [Store].[All Stores].[USA])) ' 

 SELECT

 { [measures].[TupleToStr] } ON COLUMNS, [Store].allmembers ON rows from sales

UniqueName

返回维度、级别或成员的唯一名称。

 

UserName

返回当前连接的域名和用户名。

 

with member measures.test as 'username'

select  { measures.test  } on columns,

  {  [Time].[1997], [Time].[1998]}  on rows

from Sales

 

元组函数

函数

描述

Current

返回迭代过程中集合中的当前元组。

 

with set kkk as '{{[Time].[1997], [Time].[1998]}*{[Store].[All Stores].[Canada],[Store].[All Stores].[USA]} }'

member measures.jjj as 'TupleToStr(kkk.current)',solve_order=1

select  { measures.[store sales],measures.jjj } on columns,

  {kkk} on rows

from Sales

待改!找不到current的用途!

Item

从集合中返回元组。

 

with set kkk as '{{[Time].[1997], [Time].[1998]}*{[Store].[All Stores].[Canada],[Store].[All Stores].[USA]} }'

member measures.jjj as 'TupleToStr(kkk.item(0).item(0))',solve_order=1

select  { measures.[store sales],measures.jjj } on columns,

  {kkk} on rows

from Sales

StrToTuple

用字符串构造一个元组。

 

with member measures.jjj as 'StrToTuple("([store Sales], "+time.currentmember.uniquename+")")',solve_order=1

select  {  measures.jjj } on columns,

  {time.allmembers} on rows

from Sales

 

posted on 2006-12-18 22:26  anchky  阅读(2592)  评论(4编辑  收藏  举报