开发者

A shorter way of specifying a set in MDX

Is there a brief开发者_如何学JAVAer way of specifying a set in MDX?

I know I can do something like :

{[Debtor].[TRADING DEBTOR CODE].&[AU-000013],[Debtor].[TRADING DEBTOR CODE].&[AU-000020]}

but once you get over a few members, it becomes incredibly verbose.

I'm looking for something like

MagicFunctionToMakeASet([Debtor].[TRADING DEBTOR CODE],'AU-000013,AU-000015,AU-000013,AU-000015,...')


Are they in sequence at all? If so, could you do

{
      [Debtor].[TRADING DEBTOR CODE].&[AU-000013] : 
      [Debtor].[TRADING DEBTOR CODE].&[AU-000020]
}

To give you a set of codes 13 though to 20 inclusive?

Failing that, take a look at InStr and see if it can help, it looks like it might - Or you could create some subsets using it and then combine into your final set?

http://msdn.microsoft.com/en-us/library/ms145487.aspx

From the above MSDN:

WITH SET [ChardonnayChablis] AS
   'Filter([Product].Members, (InStr(1, [Product].CurrentMember.Name, "chardonnay") <> 0) OR (InStr(1, [Product].CurrentMember.Name, "chablis") <> 0))'

SELECT
   [ChardonnayChablis] ON COLUMNS,
   {Measures.[Unit Sales]} ON ROWS
FROM Sales


There are various shortcuts. If you just want all the 'children' of a certain member, use Descendants() or .children. Or get all the members at one level with .members. You can specify a range between two members, or use a filter to match some sort of critera.

What were you after? I'll try to give a more specific example...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜