dbTalk Databases Forums  

totals

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


Discuss totals in the microsoft.public.sqlserver.olap forum.



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

Default totals - 10-17-2003 , 07:49 AM






Newbie question:

I'm trying to do some website traffic statistics.. Here's my mdx..

select nonemptycrossjoin (domain.[vch domain].members, source.[vch
source].members) on rows,
tail(time.week.members, 3) on columns
from sessions

I want to get a result like this


domain source 2 Weeks Ago Last Week This Week total
domain1 source1 10 20 25 55
domain1 source2 20 10 30 60
domain1 source3 50 50 100 200
domain1 total 80 80 155 315
domain2 source1 10 10 10 30
domain2 source2 15 15 15 45
domain2 total 25 25 25 75
..
..
grand total 1000 2000 3000 4000



What I'm missing is the totals on the extreme right, the rollup totals
for each group and the grand totals. I've worked for years in t-sql and
can do this in a snap there, but I'd like to learn how to do this in
MDX..

Any help welcome.

Ephraim..


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

Default Re: totals - 10-17-2003 , 11:43 AM






Perhaps all you need to to add the various All members to your sets (unless
these are subsets). Sort of like this:

SELECT
nonemptycrossjoin (
{domain.defaultmember, domain.[vch domain].members},
{[vch source].defaultmember, [vch source].members) on rows
etc...

tom @ the domain below
www.tomchester.net


"Ephraim" <ephieb (AT) bruderhof (DOT) com> wrote

Quote:
Newbie question:

I'm trying to do some website traffic statistics.. Here's my mdx..

select nonemptycrossjoin (domain.[vch domain].members, source.[vch
source].members) on rows,
tail(time.week.members, 3) on columns
from sessions

I want to get a result like this


domain source 2 Weeks Ago Last Week This Week total
domain1 source1 10 20 25 55
domain1 source2 20 10 30 60
domain1 source3 50 50 100 200
domain1 total 80 80 155 315
domain2 source1 10 10 10 30
domain2 source2 15 15 15 45
domain2 total 25 25 25 75
.
.
grand total 1000 2000 3000 4000



What I'm missing is the totals on the extreme right, the rollup totals
for each group and the grand totals. I've worked for years in t-sql and
can do this in a snap there, but I'd like to learn how to do this in
MDX..

Any help welcome.

Ephraim..




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

Default Re: totals - 10-20-2003 , 07:17 AM



Thanks Tom,

That was a big help, but when I try to do..

{tail(time.week.members, 3), time.defaultmember}

it doesn't give me the total for just the last three weeks for my
extreme right column... Is there an easy way to do that?

Ephraim



"Tom Chester" <publicNOSPAM (AT) tomchester (DOT) net> wrote in
news:h%Ujb.445$ZV4.12861 (AT) news (DOT) uswest.net:

Quote:
Perhaps all you need to to add the various All members to your sets
(unless these are subsets). Sort of like this:

SELECT
nonemptycrossjoin (
{domain.defaultmember, domain.[vch domain].members},
{[vch source].defaultmember, [vch source].members) on rows
etc...

tom @ the domain below
www.tomchester.net


"Ephraim" <ephieb (AT) bruderhof (DOT) com> wrote in message
news:Xns941759C24342Ewhateveritisnt (AT) 207 (DOT) 14.113.17...
Newbie question:

I'm trying to do some website traffic statistics.. Here's my mdx..

select nonemptycrossjoin (domain.[vch domain].members, source.[vch
source].members) on rows,
tail(time.week.members, 3) on columns
from sessions

I want to get a result like this


domain source 2 Weeks Ago Last Week This Week total
domain1 source1 10 20 25 55
domain1 source2 20 10 30 60
domain1 source3 50 50 100 200
domain1 total 80 80 155 315
domain2 source1 10 10 10 30
domain2 source2 15 15 15 45
domain2 total 25 25 25 75
.
.
grand total 1000 2000 3000 4000



What I'm missing is the totals on the extreme right, the rollup
totals for each group and the grand totals. I've worked for years in
t-sql and can do this in a snap there, but I'd like to learn how to
do this in MDX..

Any help welcome.

Ephraim..






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.