dbTalk Databases Forums  

CALCULATED MEMBER BASED ON MEASURES

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


Discuss CALCULATED MEMBER BASED ON MEASURES in the microsoft.public.sqlserver.olap forum.



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

Default CALCULATED MEMBER BASED ON MEASURES - 01-10-2005 , 03:39 PM






Is there a way to create a calculated member by counting the number of
records in a fact table where field1 = 0 and field2 = 0 and field3 = 0 and
Field4 = 0? These are simple indicator fields whose value is either 1 for
true or 0 for false. Are there other options?

This is a new requirement that wasn't cared for in the original OLAP design.
I'm trying to avoid having to alter the fact table and thus the ETL that
currently loads the fact table.


--
Michael Hardy
ETL Developer

Visit our web pages:
www.atlantis.com
www.oceanclub.com
www.oneandonlyresorts.com
www.kerzner.com



Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: CALCULATED MEMBER BASED ON MEASURES - 01-10-2005 , 08:28 PM






A couple of options come to mind:

- If you only need to count fact records that fulfill the one condition,
then you can define a new base 'sum' measure, say [FalseCount], whose
Source Column is a SQL expression like:

Quote:
case when field1 = 0 and field2 = 0
and field3 = 0 and field4 = 0 then 1
else 0 end
Quote:

- If you need more flexibility in analysis, simple true/false member
dimensions can be created off each indicator field. Then the count can
be a calculated measure, based on the fact table record count with each
indicator dimension member selected as "false".


- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for 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.