dbTalk Databases Forums  

MDX Question: Using Set and Tuple

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss MDX Question: Using Set and Tuple in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
PCL
 
Posts: n/a

Default MDX Question: Using Set and Tuple - 10-21-2003 , 09:02 AM






Hello,

I create in MDX query a Set named [Active]:
[Active] = {(a,1), (a,2), (b,2), (c,1), (d,3), (c,4), (b,1)} ([Active]
is a set of tuple)

How can I create a set [NoActive] that is first distinct item of each tuple
contained in [Active] set:
[NoActive] = {a, b, c, d}

Anyone can help me ?
Thanks

YD.


Usage:
WITH
SET [Active] AS '...'
SELECT { ... Measures ... } ON COLUMNS ,
{[NoActive]} ON ROWS
From [MyCube]



Reply With Quote
  #2  
Old   
Brian Altmann
 
Posts: n/a

Default MDX Question: Using Set and Tuple - 10-21-2003 , 09:38 AM






Try:

set [No Active] as 'generate([Active],
{[Active].current.item(0)})

HTH,
Brian
www.geocities.com/brianaltmann/olap.html


Quote:
-----Original Message-----
Hello,

I create in MDX query a Set named [Active]:
[Active] = {(a,1), (a,2), (b,2), (c,1), (d,3), (c,4),
(b,1)} ([Active]
is a set of tuple)

How can I create a set [NoActive] that is first distinct
item of each tuple
contained in [Active] set:
[NoActive] = {a, b, c, d}

Anyone can help me ?
Thanks

YD.


Usage:
WITH
SET [Active] AS '...'
SELECT { ... Measures ... } ON COLUMNS ,
{[NoActive]} ON ROWS
From [MyCube]


.


Reply With Quote
  #3  
Old   
PCL
 
Posts: n/a

Default Re: MDX Question: Using Set and Tuple - 10-21-2003 , 11:18 AM



Thanks a lot.
Result is very good !


"Brian Altmann" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Try:

set [No Active] as 'generate([Active],
{[Active].current.item(0)})

HTH,
Brian
www.geocities.com/brianaltmann/olap.html


-----Original Message-----
Hello,

I create in MDX query a Set named [Active]:
[Active] = {(a,1), (a,2), (b,2), (c,1), (d,3), (c,4),
(b,1)} ([Active]
is a set of tuple)

How can I create a set [NoActive] that is first distinct
item of each tuple
contained in [Active] set:
[NoActive] = {a, b, c, d}

Anyone can help me ?
Thanks

YD.


Usage:
WITH
SET [Active] AS '...'
SELECT { ... Measures ... } ON COLUMNS ,
{[NoActive]} ON ROWS
From [MyCube]


.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.