dbTalk Databases Forums  

Retrive Number of Rows for MDX

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


Discuss Retrive Number of Rows for MDX in the microsoft.public.sqlserver.olap forum.



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

Default Retrive Number of Rows for MDX - 04-18-2005 , 08:12 AM






Hi All,

Is there any method to identify the Number of Members or Rows or
Columns before executing the MDX.

Regards,
Mansoor


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

Default RE: Retrive Number of Rows for MDX - 04-18-2005 , 08:38 AM






Yes, you can use ADOMD properties to obtain this information:

You can declare an ADOMD cellset, and execute your MDX, and check the counts
of positions and/or members, something like:

cst.Axes(i).Positions(j).Members(k)


Be careful of this, if you have a long running query, it will take a long
time to obtain the information you want because the statement has to execute
completely.



"Muhammad Mansoor" wrote:

Quote:
Hi All,

Is there any method to identify the Number of Members or Rows or
Columns before executing the MDX.

Regards,
Mansoor



Reply With Quote
  #3  
Old   
Muhammad Mansoor
 
Posts: n/a

Default Re: Retrive Number of Rows for MDX - 04-18-2005 , 09:26 AM



SQL McOLAP wrote:
Quote:
Yes, you can use ADOMD properties to obtain this information:

You can declare an ADOMD cellset, and execute your MDX, and check the
counts
of positions and/or members, something like:

cst.Axes(i).Positions(j).Members(k)

Be careful of this, if you have a long running query, it will take a
long
time to obtain the information you want because the statement has to
execute
completely.

Solutions is ok, but i am willing to use it prompt the user about the
delay that this query will take a long time to execute, but it will be
useless if the user comes to know about it _AFTER_ the query is
executed.



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

Default Re: Retrive Number of Rows for MDX - 04-18-2005 , 10:25 AM



Then you'll have to know up front which queries come back quickly, and which
don't. If you don't use non-empty crossjoins (which you should for
performance) you may be able to calculate how many cells will be returned by
multiplying all dim members on the axis. If your end-users DON'T want to see
empty cells, you may be out of luck. I don't know a way of getting cellset
count without actually executing MDX. If there is a way, I'd be interested
myself.

"Muhammad Mansoor" wrote:

Quote:
SQL McOLAP wrote:
Yes, you can use ADOMD properties to obtain this information:

You can declare an ADOMD cellset, and execute your MDX, and check the
counts
of positions and/or members, something like:

cst.Axes(i).Positions(j).Members(k)

Be careful of this, if you have a long running query, it will take a
long
time to obtain the information you want because the statement has to
execute
completely.

Solutions is ok, but i am willing to use it prompt the user about the
delay that this query will take a long time to execute, but it will be
useless if the user comes to know about it _AFTER_ the query is
executed.



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.