dbTalk Databases Forums  

MDX and YTD

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


Discuss MDX and YTD in the microsoft.public.sqlserver.olap forum.



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

Default MDX and YTD - 02-12-2004 , 09:20 AM






Hi there,

I would like to run a query resulting the following table:


Produkt | Jan acc. | Feb acc. | March acc.
--------------------------------------------
Drink | 3.775,36 | 7.413,35 | 11585,80
Food | ... | ... | ...

That was all I was able to come up with so far (Foodmart):

with member [Measures].[Acc. Value] as 'Sum(YTD(),
[Measures].[Store Sales])'
select
Crossjoin({Descendants([Time].[1997],[Time].[Month])},
{[Measures].[Acc. Value]}) on columns,
{[Product].[Product Family].members} on rows
from Sales

which results in the following:
Quote:
1 |2 |3
Produkt |Acc. Value |Acc. Value|Acc. Value
--------------------------------------------
Drink | 3.775,36 | 7.413,35 | 11585,80
Food | ... | ... | ...

How can I avoid the crossjoin on columns? and what do I
have to do to label the columns as in the example above???

Thank you in advance,

Verena



Reply With Quote
  #2  
Old   
Tom Chester
 
Posts: n/a

Default Re: MDX and YTD - 02-12-2004 , 10:25 AM






Verena, is this what you mean...?

with member [Measures].[Acc. Value] as
'Sum(YTD(), [Measures].[Store Sales])'
select
Descendants([Time].[1997],[Time].[Month]) on columns,
[Product].[Product Family].members on rows
from Sales
where (Measures.[Acc. Value])

As to labeling, this depends on the front-end -- it is probable you have no
control of this.

public @ the domain below
www.tomchester.net

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

Quote:
Hi there,

I would like to run a query resulting the following table:


Produkt | Jan acc. | Feb acc. | March acc.
--------------------------------------------
Drink | 3.775,36 | 7.413,35 | 11585,80
Food | ... | ... | ...

That was all I was able to come up with so far (Foodmart):

with member [Measures].[Acc. Value] as 'Sum(YTD(),
[Measures].[Store Sales])'
select
Crossjoin({Descendants([Time].[1997],[Time].[Month])},
{[Measures].[Acc. Value]}) on columns,
{[Product].[Product Family].members} on rows
from Sales

which results in the following:
|1 |2 |3
Produkt |Acc. Value |Acc. Value|Acc. Value
--------------------------------------------
Drink | 3.775,36 | 7.413,35 | 11585,80
Food | ... | ... | ...

How can I avoid the crossjoin on columns? and what do I
have to do to label the columns as in the example above???

Thank you in advance,

Verena




Reply With Quote
  #3  
Old   
 
Posts: n/a

Default Re: MDX and YTD - 02-15-2004 , 01:33 PM



Hi Tom,
reliable as usual ;-)!!! That's exactly what I meant
thank you.
verena

Quote:
-----Original Message-----
Verena, is this what you mean...?

with member [Measures].[Acc. Value] as
'Sum(YTD(), [Measures].[Store Sales])'
select
Descendants([Time].[1997],[Time].[Month]) on columns,
[Product].[Product Family].members on rows
from Sales
where (Measures.[Acc. Value])

As to labeling, this depends on the front-end -- it is
probable you have no
control of this.

public @ the domain below
www.tomchester.net

"verena" <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message
news:f44301c3f17b$cd3638a0$a401280a (AT) phx (DOT) gbl...
Hi there,

I would like to run a query resulting the following
table:


Produkt | Jan acc. | Feb acc. | March acc.
--------------------------------------------
Drink | 3.775,36 | 7.413,35 | 11585,80
Food | ... | ... | ...

That was all I was able to come up with so far
(Foodmart):

with member [Measures].[Acc. Value] as 'Sum(YTD(),
[Measures].[Store Sales])'
select
Crossjoin({Descendants([Time].[1997],[Time].[Month])},
{[Measures].[Acc. Value]}) on columns,
{[Product].[Product Family].members} on rows
from Sales

which results in the following:
|1 |2 |3
Produkt |Acc. Value |Acc. Value|Acc. Value
--------------------------------------------
Drink | 3.775,36 | 7.413,35 | 11585,80
Food | ... | ... | ...

How can I avoid the crossjoin on columns? and what do I
have to do to label the columns as in the example
above???

Thank you in advance,

Verena



.


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.