dbTalk Databases Forums  

improving or correcting this MDX query

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


Discuss improving or correcting this MDX query in the microsoft.public.sqlserver.olap forum.



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

Default improving or correcting this MDX query - 09-05-2006 , 09:17 AM






WITH
Member [Account Name].[No. Accounts]
AS
'COUNT(
crossjoin(
nonemptycrossjoin([Account Name].[Account Name].MEMBERS,
{[Measures].[Total Sold Products]},1),{[Measures].[Total Sales Amount]}),
Excludeempty)'
SELECT
{ [Account Name].[No. Accounts] } ON COLUMNS,

{[Transactions].[Transaction Type].Members} ON ROWS
FROM
[Total Revenue]


I get 0 results from this query. Can someone tell me why?

Reply With Quote
  #2  
Old   
Jéjé
 
Posts: n/a

Default Re: improving or correcting this MDX query - 09-05-2006 , 10:14 AM






this formula could provide wrong results regarding some connectionstring
parameters.
try this first:
'COUNT(
crossjoin(
[Account Name].[Account Name].MEMBERS,
{[Measures].[Total Sales Amount]}),
Excludeempty)'

(remove the nonemptycrossjoin)

slower, but should always provide the right result


"SAM" <SAM (AT) discussions (DOT) microsoft.com> wrote

Quote:
WITH
Member [Account Name].[No. Accounts]
AS
'COUNT(
crossjoin(
nonemptycrossjoin([Account Name].[Account Name].MEMBERS,
{[Measures].[Total Sold Products]},1),{[Measures].[Total Sales Amount]}),
Excludeempty)'
SELECT
{ [Account Name].[No. Accounts] } ON COLUMNS,

{[Transactions].[Transaction Type].Members} ON ROWS
FROM
[Total Revenue]


I get 0 results from this query. Can someone tell me why?



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

Default Re: improving or correcting this MDX query - 09-05-2006 , 10:45 AM



I was using the the suggested query and got the results. I was using the
nonemptycrossjoin to see if it helps with performance but I received zero
when in the Cube browser or MDX sample application.

"Jéjé" wrote:

Quote:
this formula could provide wrong results regarding some connectionstring
parameters.
try this first:
'COUNT(
crossjoin(
[Account Name].[Account Name].MEMBERS,
{[Measures].[Total Sales Amount]}),
Excludeempty)'

(remove the nonemptycrossjoin)

slower, but should always provide the right result


"SAM" <SAM (AT) discussions (DOT) microsoft.com> wrote in message
news:6BB0690B-0E32-44D4-9B8A-46D45BEA5C92 (AT) microsoft (DOT) com...
WITH
Member [Account Name].[No. Accounts]
AS
'COUNT(
crossjoin(
nonemptycrossjoin([Account Name].[Account Name].MEMBERS,
{[Measures].[Total Sold Products]},1),{[Measures].[Total Sales Amount]}),
Excludeempty)'
SELECT
{ [Account Name].[No. Accounts] } ON COLUMNS,

{[Transactions].[Transaction Type].Members} ON ROWS
FROM
[Total Revenue]


I get 0 results from this query. Can someone tell me why?




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

Default Re: improving or correcting this MDX query - 09-14-2006 , 10:44 AM



Jeje,

Do you have any suggestions on how to improve the performance of this query?
It runs the same in AS2005.

"Jéjé" wrote:

Quote:
this formula could provide wrong results regarding some connectionstring
parameters.
try this first:
'COUNT(
crossjoin(
[Account Name].[Account Name].MEMBERS,
{[Measures].[Total Sales Amount]}),
Excludeempty)'

(remove the nonemptycrossjoin)

slower, but should always provide the right result


"SAM" <SAM (AT) discussions (DOT) microsoft.com> wrote in message
news:6BB0690B-0E32-44D4-9B8A-46D45BEA5C92 (AT) microsoft (DOT) com...
WITH
Member [Account Name].[No. Accounts]
AS
'COUNT(
crossjoin(
nonemptycrossjoin([Account Name].[Account Name].MEMBERS,
{[Measures].[Total Sold Products]},1),{[Measures].[Total Sales Amount]}),
Excludeempty)'
SELECT
{ [Account Name].[No. Accounts] } ON COLUMNS,

{[Transactions].[Transaction Type].Members} ON ROWS
FROM
[Total Revenue]


I get 0 results from this query. Can someone tell me why?




Reply With Quote
  #5  
Old   
Jéjé
 
Posts: n/a

Default Re: improving or correcting this MDX query - 09-14-2006 , 04:15 PM



in AS2005 you no longer need this formula!

the distinct count aggregation in AS2005 works fine in any combination
(simple and multiple filters, visuatotal works fine too)
so create a standard measure using the distinct count agggregation option
and its all!


"SAM" <SAM (AT) discussions (DOT) microsoft.com> wrote

Quote:
Jeje,

Do you have any suggestions on how to improve the performance of this
query?
It runs the same in AS2005.

"Jéjé" wrote:

this formula could provide wrong results regarding some connectionstring
parameters.
try this first:
'COUNT(
crossjoin(
[Account Name].[Account Name].MEMBERS,
{[Measures].[Total Sales Amount]}),
Excludeempty)'

(remove the nonemptycrossjoin)

slower, but should always provide the right result


"SAM" <SAM (AT) discussions (DOT) microsoft.com> wrote in message
news:6BB0690B-0E32-44D4-9B8A-46D45BEA5C92 (AT) microsoft (DOT) com...
WITH
Member [Account Name].[No. Accounts]
AS
'COUNT(
crossjoin(
nonemptycrossjoin([Account Name].[Account Name].MEMBERS,
{[Measures].[Total Sold Products]},1),{[Measures].[Total Sales
Amount]}),
Excludeempty)'
SELECT
{ [Account Name].[No. Accounts] } ON COLUMNS,

{[Transactions].[Transaction Type].Members} ON ROWS
FROM
[Total Revenue]


I get 0 results from this query. Can someone tell me why?






Reply With Quote
  #6  
Old   
SAM
 
Posts: n/a

Default Re: improving or correcting this MDX query - 09-14-2006 , 04:52 PM



ok thanks. I guess there is no hope for this in AS 2000?

I haven't tried adding a measure in the Fact table to count the number of
clients in AS 2000.

"Jéjé" wrote:

Quote:
in AS2005 you no longer need this formula!

the distinct count aggregation in AS2005 works fine in any combination
(simple and multiple filters, visuatotal works fine too)
so create a standard measure using the distinct count agggregation option
and its all!


"SAM" <SAM (AT) discussions (DOT) microsoft.com> wrote in message
news:E092D1A0-3036-49A1-91D5-8EEBD85EB64B (AT) microsoft (DOT) com...
Jeje,

Do you have any suggestions on how to improve the performance of this
query?
It runs the same in AS2005.

"Jéjé" wrote:

this formula could provide wrong results regarding some connectionstring
parameters.
try this first:
'COUNT(
crossjoin(
[Account Name].[Account Name].MEMBERS,
{[Measures].[Total Sales Amount]}),
Excludeempty)'

(remove the nonemptycrossjoin)

slower, but should always provide the right result


"SAM" <SAM (AT) discussions (DOT) microsoft.com> wrote in message
news:6BB0690B-0E32-44D4-9B8A-46D45BEA5C92 (AT) microsoft (DOT) com...
WITH
Member [Account Name].[No. Accounts]
AS
'COUNT(
crossjoin(
nonemptycrossjoin([Account Name].[Account Name].MEMBERS,
{[Measures].[Total Sold Products]},1),{[Measures].[Total Sales
Amount]}),
Excludeempty)'
SELECT
{ [Account Name].[No. Accounts] } ON COLUMNS,

{[Transactions].[Transaction Type].Members} ON ROWS
FROM
[Total Revenue]


I get 0 results from this query. Can someone tell me why?







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.