dbTalk Databases Forums  

newbie query help

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


Discuss newbie query help in the microsoft.public.sqlserver.olap forum.



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

Default newbie query help - 07-13-2004 , 12:24 PM






select {[Subs Count], [Unsub Count]} on Columns, {[Time].[2003]} on Rows
from [Consumer]

This query works fine, but I want 2 time periods.
With this query I get

time | subs | unsub
2003 5 1


but I want
2003 | 5 | 1|
2002 | 6 | 2|
2001 | 4 | 3|


I tried CrossJoin({[Time].[2003]},{[Time].[2002]},{[Time].[2001]})
I tried it without the set

I also tried

select {[Subs Count], [Unsub Count]} on Columns from [Consumer] where
[Time].[2003] or [Time].[2002]
but that didn't like it.



Reply With Quote
  #2  
Old   
Cindy Lee
 
Posts: n/a

Default Re: newbie query help - 07-13-2004 , 12:54 PM






or is it possible to do a
select {[Subs Count], [Unsub Count]} on Columns, {[Time].[2003]} on Rows
from [Consumer]
union all
select {[Subs Count], [Unsub Count]} on Columns, {[Time].[2002]} on Rows
from [Consumer]

"Cindy Lee" <cindylee (AT) hotmail (DOT) com> wrote

Quote:
select {[Subs Count], [Unsub Count]} on Columns, {[Time].[2003]} on Rows
from [Consumer]

This query works fine, but I want 2 time periods.
With this query I get

time | subs | unsub
2003 5 1


but I want
2003 | 5 | 1|
2002 | 6 | 2|
2001 | 4 | 3|


I tried CrossJoin({[Time].[2003]},{[Time].[2002]},{[Time].[2001]})
I tried it without the set

I also tried

select {[Subs Count], [Unsub Count]} on Columns from [Consumer] where
[Time].[2003] or [Time].[2002]
but that didn't like it.





Reply With Quote
  #3  
Old   
Cindy Lee
 
Posts: n/a

Default Re: newbie query help - 07-13-2004 , 02:02 PM



No, I don't want all the members, just 2003, 2002, and 2001 for example

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

Quote:
try

select {[Subs Count], [Unsub Count]} on Columns, {[Time].[Year].members}
on Rows from [Consumer]

Cheers,
Sanka


"Cindy Lee" wrote:

or is it possible to do a
select {[Subs Count], [Unsub Count]} on Columns, {[Time].[2003]} on
Rows
from [Consumer]
union all
select {[Subs Count], [Unsub Count]} on Columns, {[Time].[2002]} on
Rows
from [Consumer]

"Cindy Lee" <cindylee (AT) hotmail (DOT) com> wrote in message
news:uoa9T5PaEHA.1656 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
select {[Subs Count], [Unsub Count]} on Columns, {[Time].[2003]} on
Rows
from [Consumer]

This query works fine, but I want 2 time periods.
With this query I get

time | subs | unsub
2003 5 1


but I want
2003 | 5 | 1|
2002 | 6 | 2|
2001 | 4 | 3|


I tried CrossJoin({[Time].[2003]},{[Time].[2002]},{[Time].[2001]})
I tried it without the set

I also tried

select {[Subs Count], [Unsub Count]} on Columns from [Consumer]
where
[Time].[2003] or [Time].[2002]
but that didn't like it.








Reply With Quote
  #4  
Old   
Michael Barrett Jensen
 
Posts: n/a

Default Re: newbie query help - 07-13-2004 , 04:10 PM



Try this

select {[Subs Count], [Unsub Count]} on Columns,
{[Time].[Year].[2003], [Time].[Year].[2002], [Time].[Year].[2001]}on
Rows
from [Consumer]

--
Michael

"Cindy Lee" <cindylee (AT) hotmail (DOT) com> wrote

Quote:
No, I don't want all the members, just 2003, 2002, and 2001 for example

"Sanka" <Sanka (AT) discussions (DOT) microsoft.com> wrote in message
news:A372E628-F7CE-4E27-9F6F-05A97EDEDC1D (AT) microsoft (DOT) com...

try

select {[Subs Count], [Unsub Count]} on Columns, {[Time].[Year].members}
on Rows from [Consumer]

Cheers,
Sanka


"Cindy Lee" wrote:

or is it possible to do a
select {[Subs Count], [Unsub Count]} on Columns, {[Time].[2003]} on
Rows
from [Consumer]
union all
select {[Subs Count], [Unsub Count]} on Columns, {[Time].[2002]} on
Rows
from [Consumer]

"Cindy Lee" <cindylee (AT) hotmail (DOT) com> wrote in message
news:uoa9T5PaEHA.1656 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
select {[Subs Count], [Unsub Count]} on Columns, {[Time].[2003]} on
Rows
from [Consumer]

This query works fine, but I want 2 time periods.
With this query I get

time | subs | unsub
2003 5 1


but I want
2003 | 5 | 1|
2002 | 6 | 2|
2001 | 4 | 3|


I tried CrossJoin({[Time].[2003]},{[Time].[2002]},{[Time].[2001]})
I tried it without the set

I also tried

select {[Subs Count], [Unsub Count]} on Columns from [Consumer]
where
[Time].[2003] or [Time].[2002]
but that didn't like it.










Reply With Quote
  #5  
Old   
Cindy Lee
 
Posts: n/a

Default Re: newbie query help - 07-13-2004 , 04:58 PM



yeah, thanks that worked.
"Michael Barrett Jensen" <pwuh1ml02@|DeleteThis|sneakemail.com> wrote in
message news:uKjmD3RaEHA.3524 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
Quote:
Try this

select {[Subs Count], [Unsub Count]} on Columns,
{[Time].[Year].[2003], [Time].[Year].[2002], [Time].[Year].[2001]}on
Rows
from [Consumer]

--
Michael

"Cindy Lee" <cindylee (AT) hotmail (DOT) com> wrote in message
news:%23b9GKwQaEHA.712 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
No, I don't want all the members, just 2003, 2002, and 2001 for example

"Sanka" <Sanka (AT) discussions (DOT) microsoft.com> wrote in message
news:A372E628-F7CE-4E27-9F6F-05A97EDEDC1D (AT) microsoft (DOT) com...

try

select {[Subs Count], [Unsub Count]} on Columns,
{[Time].[Year].members}
on Rows from [Consumer]

Cheers,
Sanka


"Cindy Lee" wrote:

or is it possible to do a
select {[Subs Count], [Unsub Count]} on Columns, {[Time].[2003]} on
Rows
from [Consumer]
union all
select {[Subs Count], [Unsub Count]} on Columns, {[Time].[2002]} on
Rows
from [Consumer]

"Cindy Lee" <cindylee (AT) hotmail (DOT) com> wrote in message
news:uoa9T5PaEHA.1656 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
select {[Subs Count], [Unsub Count]} on Columns, {[Time].[2003]}
on
Rows
from [Consumer]

This query works fine, but I want 2 time periods.
With this query I get

time | subs | unsub
2003 5 1


but I want
2003 | 5 | 1|
2002 | 6 | 2|
2001 | 4 | 3|


I tried CrossJoin({[Time].[2003]},{[Time].[2002]},{[Time].[2001]})
I tried it without the set

I also tried

select {[Subs Count], [Unsub Count]} on Columns from [Consumer]
where
[Time].[2003] or [Time].[2002]
but that didn't like it.












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.