dbTalk Databases Forums  

"SELECT *" in MDX

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


Discuss "SELECT *" in MDX in the microsoft.public.sqlserver.olap forum.



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

Default "SELECT *" in MDX - 05-17-2005 , 03:13 PM






Is there an easy way to query something along the lines of "SELECT *"
from a cube? Or must one always define row/column members?

I need to "select *", on just one axis with a "where" slicer as well.

Thanks in advance,

Alex


Reply With Quote
  #2  
Old   
SQL McOLAP
 
Posts: n/a

Default RE: "SELECT *" in MDX - 05-17-2005 , 03:59 PM






"*" is easy in SQL, it just means all the columns of the table. But since
OLAP is 3 dimensional and not 2 dimensional like SQL, you have to tell it
what "*" is.

If what you mean by "*" is just the measures, you could write something like:

SELECT {[Measures].members} on columns
FROM [Your Cube]
WHERE whatever

This will work in the Sample app but some front ends (like Pro Clarity)
won't allow it because the "on rows" statement isn't provided. If you're
using ADOMD, or ADOMD.NET, it will work, though.

Good luck!

- Phil

"Alex" wrote:

Quote:
Is there an easy way to query something along the lines of "SELECT *"
from a cube? Or must one always define row/column members?

I need to "select *", on just one axis with a "where" slicer as well.

Thanks in advance,

Alex



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

Default Re: "SELECT *" in MDX - 05-18-2005 , 01:50 AM



Manager 4.0 client supports this syntax. More to the point, it generates
syntax for MDX queries you can look at. So if you design queries in GUI you
can always look at the syntax behind it. Demo should be downloadable from
www.softpro.hr



MC

"SQL McOLAP" <SQLMcOLAP (AT) discussions (DOT) microsoft.com> wrote

Quote:
"*" is easy in SQL, it just means all the columns of the table. But since
OLAP is 3 dimensional and not 2 dimensional like SQL, you have to tell it
what "*" is.

If what you mean by "*" is just the measures, you could write something
like:

SELECT {[Measures].members} on columns
FROM [Your Cube]
WHERE whatever

This will work in the Sample app but some front ends (like Pro Clarity)
won't allow it because the "on rows" statement isn't provided. If you're
using ADOMD, or ADOMD.NET, it will work, though.

Good luck!

- Phil

"Alex" wrote:

Is there an easy way to query something along the lines of "SELECT *"
from a cube? Or must one always define row/column members?

I need to "select *", on just one axis with a "where" slicer as well.

Thanks in advance,

Alex





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

Default Re: "SELECT *" in MDX - 05-18-2005 , 03:20 PM



What if I'd like more than one dimension per row? (or all dimensions)


E.G. -


"select


[Measures].Members on columns,
{[Date].Members, [Product].members} on rows


from [KPI Warehouse]"


Reply With Quote
  #5  
Old   
MC
 
Posts: n/a

Default Re: "SELECT *" in MDX - 05-19-2005 , 02:19 AM



You can use CrossJoin function. Something like this:

select
[Measures].Members on columns,
CrossJoin
(
{[Date].Members},
{[Product].members}
) on rows

From .....


"Alex" <fwd_newsgroups (AT) hotmail (DOT) com> wrote

Quote:
What if I'd like more than one dimension per row? (or all dimensions)


E.G. -


"select


[Measures].Members on columns,
{[Date].Members, [Product].members} on rows


from [KPI Warehouse]"




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.