dbTalk Databases Forums  

How to combine two members of a Dimension into a Tuple?

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


Discuss How to combine two members of a Dimension into a Tuple? in the microsoft.public.sqlserver.olap forum.



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

Default How to combine two members of a Dimension into a Tuple? - 06-11-2006 , 08:40 PM






Hi all! Unfortunately I'm faced with a problem for which I can't find a
solution. The requirement I'm facing seems not too exotic therefore I
hope you came across it too. I'm analyzing receipts and I need to know
how many of them contain products A and B. I know how to query the
number of receipts that contain product A ([Measures].[Receipts],
[Product].[A]) but since a tuple can only contain one member of a
dimension, it is impossible to add Product B to the query.

Thanks for any help!

Martin


Reply With Quote
  #2  
Old   
Tim Dot NoSpam
 
Posts: n/a

Default Re: How to combine two members of a Dimension into a Tuple? - 06-12-2006 , 05:51 AM






Hi Martin.

WHERE { [Measures].[Receipts].[Product].[A] :
[Measures].[Receipts].[Product].[b] }

Have you tried range inclusion?

<kontakt (AT) ryf (DOT) de> wrote

Quote:
Hi all! Unfortunately I'm faced with a problem for which I can't find a
solution. The requirement I'm facing seems not too exotic therefore I
hope you came across it too. I'm analyzing receipts and I need to know
how many of them contain products A and B. I know how to query the
number of receipts that contain product A ([Measures].[Receipts],
[Product].[A]) but since a tuple can only contain one member of a
dimension, it is impossible to add Product B to the query.

Thanks for any help!

Martin




Reply With Quote
  #3  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: How to combine two members of a Dimension into a Tuple? - 06-12-2006 , 06:43 AM




If these members are not next to each other in the hierarchy you can
also just list the members in a set separated by commas.

eg.

WHERE {[Product].[A], [Product].[b] }

Mind you the above will only work in AS2k5. In AS2k you would need to
aggregate or sum the set of members

eg.

WITH
Member Measures.AB as { [Measures].[Receipts].[Product].[A],
[Measures].[Receipts].[Product].[b] }
SELECT
Measures.AB on columns
FROM <Cube>

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <eMpE74gjGHA.4512 (AT) TK2MSFTNGP04 (DOT) phx.gbl>,
Tim.NoSpam (AT) hughes (DOT) net says...
Quote:
Hi Martin.

WHERE { [Measures].[Receipts].[Product].[A] :
[Measures].[Receipts].[Product].[b] }

Have you tried range inclusion?

kontakt (AT) ryf (DOT) de> wrote in message
news:1150076455.192761.298360 (AT) g10g2000cwb (DOT) googlegroups.com...
Hi all! Unfortunately I'm faced with a problem for which I can't find a
solution. The requirement I'm facing seems not too exotic therefore I
hope you came across it too. I'm analyzing receipts and I need to know
how many of them contain products A and B. I know how to query the
number of receipts that contain product A ([Measures].[Receipts],
[Product].[A]) but since a tuple can only contain one member of a
dimension, it is impossible to add Product B to the query.

Thanks for any help!

Martin





Reply With Quote
  #4  
Old   
AT
 
Posts: n/a

Default Re: How to combine two members of a Dimension into a Tuple? - 06-12-2006 , 07:11 AM



Thank you very much for your help.

Unfortunately what I'm looking for is a slightly different problem. I
need to know how many Receipts contain both Products A and B not just
one of them. Therefore I need a Tuple that contains both Products I
guess. But I have no clue how to construct such. Any help is welcome.

Thanks,

Martin


Reply With Quote
  #5  
Old   
Ohjoo Kwon
 
Posts: n/a

Default Re: How to combine two members of a Dimension into a Tuple? - 06-12-2006 , 07:42 PM



I understand you want the case of basekt analysis.

Google search will give you many related information with keyword of MDX and
"basket analysis"

Ohjoo

<kontakt (AT) ryf (DOT) de> wrote

Quote:
Thank you very much for your help.

Unfortunately what I'm looking for is a slightly different problem. I
need to know how many Receipts contain both Products A and B not just
one of them. Therefore I need a Tuple that contains both Products I
guess. But I have no clue how to construct such. Any help is welcome.

Thanks,

Martin




Reply With Quote
  #6  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: How to combine two members of a Dimension into a Tuple? - 06-13-2006 , 06:54 AM



Ohjoo is correct, what you are talking about is known as basket
analysis. Amir Netz (one of the key people behind Analysis Services)
wrote the following article on the subject:

http://msdn.microsoft.com/library/de...l=/library/en-
us/dnsql2k/html/distinct2.asp

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <OwERyIojGHA.1204 (AT) TK2MSFTNGP02 (DOT) phx.gbl>, ojkwon (AT) olap (DOT) co.kr
says...
Quote:
I understand you want the case of basekt analysis.

Google search will give you many related information with keyword of MDX and
"basket analysis"

Ohjoo

kontakt (AT) ryf (DOT) de> wrote in message
news:1150114269.024513.9200 (AT) i40g2000cwc (DOT) googlegroups.com...
Thank you very much for your help.

Unfortunately what I'm looking for is a slightly different problem. I
need to know how many Receipts contain both Products A and B not just
one of them. Therefore I need a Tuple that contains both Products I
guess. But I have no clue how to construct such. Any help is welcome.

Thanks,

Martin





Reply With Quote
  #7  
Old   
yongli
 
Posts: n/a

Default Re: How to combine two members of a Dimension into a Tuple? - 06-15-2006 , 12:22 PM



Or do it in two steps, first find all the receipts contains A, then filter
those receipts that contains B.

"kontakt (AT) ryf (DOT) de" wrote:

Quote:
Thank you very much for your help.

Unfortunately what I'm looking for is a slightly different problem. I
need to know how many Receipts contain both Products A and B not just
one of them. Therefore I need a Tuple that contains both Products I
guess. But I have no clue how to construct such. Any help is welcome.

Thanks,

Martin



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.