dbTalk Databases Forums  

Need help with the syntax

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


Discuss Need help with the syntax in the microsoft.public.sqlserver.olap forum.



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

Default Need help with the syntax - 08-02-2006 , 12:08 PM






Hi,

Please see the results below. I am getting the count for 'Total' as 0. I
need to get 2 to be able to apply right calculations down the line.

Please suggest a wat to achieve the right count for 'Total'.

with
set [Time set] as
'{[Time].[Hierarchy].[Yr_Mo].&[200301],
[Time].[Hierarchy].[Yr_Mo].&[200302]}'
member [Time].[Hierarchy].[Total] as 'AGGREGATE([Time set])'

select
{[Time set],[Time].[Hierarchy].[Total]} on columns,
{[Gender].[Hierarchy].children,[Gender].[Hierarchy]} on rows
from [HR Model]
where ([measures].[EmployeeCount])


200301 200302 Total
Count 1 1 0


Thanks,

Reply With Quote
  #2  
Old   
Prasad
 
Posts: n/a

Default RE: Need help with the syntax - 08-02-2006 , 01:23 PM






Here is the my MDX. Please ignore the MDX in my earlier post. It has typos etc.
I want to make the "Total" the parent for '200301' & '200302' and get the
count as 2. For some reason, it does not seem to understand it as the parent
& returns 0. I want to see 2 as i created 2 children for it.

I am not sure if there are MDX functions that can create on the fly.

with
Set [Time set] as
'{[Time].[Hierarchy].[Yr_Mo].&[200301],
[Time].[Hierarchy].[Yr_Mo].&[200302]}'
member [Time].[Hierarchy].[Total] as 'AGGREGATE([Time set])'

member [Measures].[Count] as
'count(Descendants([Time].CurrentMember,[Time].[Hierarchy].[Yr_Mo]))'

select
{[Time set],[Time].[Hierarchy].[Total]}on columns,
[Measures].[Count] on rows
from
[HR Model]

200301 200302 Total
Count 1 1 0

Thanks,

"Prasad" wrote:

Quote:
Hi,

Please see the results below. I am getting the count for 'Total' as 0. I
need to get 2 to be able to apply right calculations down the line.

Please suggest a wat to achieve the right count for 'Total'.

with
set [Time set] as
'{[Time].[Hierarchy].[Yr_Mo].&[200301],
[Time].[Hierarchy].[Yr_Mo].&[200302]}'
member [Time].[Hierarchy].[Total] as 'AGGREGATE([Time set])'

select
{[Time set],[Time].[Hierarchy].[Total]} on columns,
{[Gender].[Hierarchy].children,[Gender].[Hierarchy]} on rows
from [HR Model]
where ([measures].[EmployeeCount])


200301 200302 Total
Count 1 1 0


Thanks,

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

Default RE: Need help with the syntax - 08-04-2006 , 01:20 PM



since the cell overlaps with two calculations, you need to define a higher
solve order for your member, something like [Time].[Hierarchy].[Total] as '',
solve_order=2

"Prasad" wrote:

Quote:
Here is the my MDX. Please ignore the MDX in my earlier post. It has typos etc.
I want to make the "Total" the parent for '200301' & '200302' and get the
count as 2. For some reason, it does not seem to understand it as the parent
& returns 0. I want to see 2 as i created 2 children for it.

I am not sure if there are MDX functions that can create on the fly.

with
Set [Time set] as
'{[Time].[Hierarchy].[Yr_Mo].&[200301],
[Time].[Hierarchy].[Yr_Mo].&[200302]}'
member [Time].[Hierarchy].[Total] as 'AGGREGATE([Time set])'

member [Measures].[Count] as
'count(Descendants([Time].CurrentMember,[Time].[Hierarchy].[Yr_Mo]))'

select
{[Time set],[Time].[Hierarchy].[Total]}on columns,
[Measures].[Count] on rows
from
[HR Model]

200301 200302 Total
Count 1 1 0

Thanks,

"Prasad" wrote:

Hi,

Please see the results below. I am getting the count for 'Total' as 0. I
need to get 2 to be able to apply right calculations down the line.

Please suggest a wat to achieve the right count for 'Total'.

with
set [Time set] as
'{[Time].[Hierarchy].[Yr_Mo].&[200301],
[Time].[Hierarchy].[Yr_Mo].&[200302]}'
member [Time].[Hierarchy].[Total] as 'AGGREGATE([Time set])'

select
{[Time set],[Time].[Hierarchy].[Total]} on columns,
{[Gender].[Hierarchy].children,[Gender].[Hierarchy]} on rows
from [HR Model]
where ([measures].[EmployeeCount])


200301 200302 Total
Count 1 1 0


Thanks,

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.