dbTalk Databases Forums  

Calculated measure COUNT

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


Discuss Calculated measure COUNT in the microsoft.public.sqlserver.olap forum.



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

Default Calculated measure COUNT - 11-29-2004 , 06:04 AM






Hello!

My MDX Query looks like this:

WITH
MEMBER [Store Type].[COUNT] AS 'COUNT(([Store Type].[All Store
Type].Children))'
select {([Store Type].[All Store Type].Children),([Store Type].[COUNT])} on
rows,
{([Customers])} on columns
from Sales

And it works fine (COUNT value is 6)
but when I add measure in the where clause, so it looks like this

WITH
MEMBER [Store Type].[COUNT] AS 'COUNT(([Store Type].[All Store
Type].Children))'
select {([Store Type].[All Store Type].Children),([Store Type].[COUNT])} on
rows,
{([Customers])} on columns
from Sales
where ([Measures].[Profit])

COUNT value is 0

What should I do to get count value with selected measure

Thanks for any advice,

Peter





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

Default RE: Calculated measure COUNT - 11-29-2004 , 07:11 AM






Profit is a Calculated Measure, and it is taking precedence over count.
If you specify a higher solve_order for count it should work as you expect:

WITH
MEMBER [Store Type].[COUNT] AS 'COUNT(([Store Type].[All Store
Type].Children))',Solve_Order=1

For more info on Solve Order, see
"Understanding Pass Order and Solve Order" in BOL.

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


"PN" wrote:

Quote:
Hello!

My MDX Query looks like this:

WITH
MEMBER [Store Type].[COUNT] AS 'COUNT(([Store Type].[All Store
Type].Children))'
select {([Store Type].[All Store Type].Children),([Store Type].[COUNT])} on
rows,
{([Customers])} on columns
from Sales

And it works fine (COUNT value is 6)
but when I add measure in the where clause, so it looks like this

WITH
MEMBER [Store Type].[COUNT] AS 'COUNT(([Store Type].[All Store
Type].Children))'
select {([Store Type].[All Store Type].Children),([Store Type].[COUNT])} on
rows,
{([Customers])} on columns
from Sales
where ([Measures].[Profit])

COUNT value is 0

What should I do to get count value with selected measure

Thanks for any advice,

Peter






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

Default Re: Calculated measure COUNT - 11-29-2004 , 08:56 AM



Hi!

Thanks! It works!

Peter


"Brian Altmann" <findme@thesignaturewebsite> wrote

Quote:
Profit is a Calculated Measure, and it is taking precedence over count.
If you specify a higher solve_order for count it should work as you
expect:

WITH
MEMBER [Store Type].[COUNT] AS 'COUNT(([Store Type].[All Store
Type].Children))',Solve_Order=1

For more info on Solve Order, see
"Understanding Pass Order and Solve Order" in BOL.

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


"PN" wrote:

Hello!

My MDX Query looks like this:

WITH
MEMBER [Store Type].[COUNT] AS 'COUNT(([Store Type].[All Store
Type].Children))'
select {([Store Type].[All Store Type].Children),([Store Type].[COUNT])}
on
rows,
{([Customers])} on columns
from Sales

And it works fine (COUNT value is 6)
but when I add measure in the where clause, so it looks like this

WITH
MEMBER [Store Type].[COUNT] AS 'COUNT(([Store Type].[All Store
Type].Children))'
select {([Store Type].[All Store Type].Children),([Store Type].[COUNT])}
on
rows,
{([Customers])} on columns
from Sales
where ([Measures].[Profit])

COUNT value is 0

What should I do to get count value with selected measure

Thanks for any advice,

Peter








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.