dbTalk Databases Forums  

Question for Fact table-Urgent

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


Discuss Question for Fact table-Urgent in the microsoft.public.sqlserver.olap forum.



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

Default Question for Fact table-Urgent - 07-04-2005 , 12:13 PM






Hi,

If from fact table I want to create 3 measures
like
Sum(Data) where id = 1
Sum(Data) where id = 2
Sum(Data) where id = 3

Can I do it in one fact table or
I need to create 3 different view for 3 different where condition

--
Thanks

Am



Reply With Quote
  #2  
Old   
Jéjé
 
Posts: n/a

Default Re: Question for Fact table-Urgent - 07-04-2005 , 07:29 PM






try anything like:

select ...
sum(case when id= 1 then Data else null end ) as Measure1,
sum(case when id= 2 then Data else null end ) as Measure2,
sum(case when id= 3 then Data else null end ) as Measure3
from table

or
select ...
case when id= 1 then Data else null end as Measure1,
case when id= 2 then Data else null end as Measure2,
case when id= 3 then Data else null end as Measure3
from table
(no group by and no sum)

1 pass 1 view and 3 measures

does this helps you?

"AM" <anonymous (AT) developersdex (DOT) com> wrote

Quote:
Hi,

If from fact table I want to create 3 measures
like
Sum(Data) where id = 1
Sum(Data) where id = 2
Sum(Data) where id = 3

Can I do it in one fact table or
I need to create 3 different view for 3 different where condition

--
Thanks

Am





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.