dbTalk Databases Forums  

Calculations using SCOPE

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


Discuss Calculations using SCOPE in the microsoft.public.sqlserver.olap forum.



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

Default Calculations using SCOPE - 05-11-2006 , 04:32 PM






Good Afternoon, All!

I have created multiple Running Total calc. members in my cube (one for each
measure). The only difference between them is the actual measure that they
use. One uses Units (Units Running Total), another uses Profit (Profit
Running Total), etc. An example of one of them is listed below. Is there a
way to create these Running Totals using the SCOPE command/feature; thus,
eliminating the repetition?

Thanks in advance!

CREATE MEMBER CURRENTCUBE.MEASURES.[Units Running Total]
as
case
when [Time].[Time].currentmember.level.ordinal <= 1
then
SUM(periodstodate([Time].[Time].currentmember.level,[Time].[Time].currentmember),[MEASURES].[Units])
when [Time].[Time].currentmember.level.ordinal < 5
then

SUM(periodstodate([Time].[Time].currentmember.parent.level,[Time].[Time].currentmember),[MEASURES].[Units])
else

SUM(periodstodate([Time].[Time].currentmember.parent.parent.level,[Time].[Time].currentmember),[MEASURES].[Units])
end,
FORMAT_STRING = "#,#",
VISIBLE = 1
;

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

Default Re: Calculations using SCOPE - 05-11-2006 , 10:51 PM






Why not try adding Time Intelligence (included with the Business
Intelligence Wizard):

http://msdn2.microsoft.com/en-us/library/ms175440.aspx
Quote:
Defining Time Intelligence Calculations using the Business Intelligence
Wizard

The time intelligence enhancement is a cube enhancement that adds time
calculations (or time views) to a selected hierarchy. This enhancement
supports the following categories of calculations:

Period to date.

Period over period growth.

Moving averages.

Parallel period comparisons.
...
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


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

Default Re: Calculations using SCOPE - 05-12-2006 , 10:33 AM



Hi Deepak,

Thank you for your reply. I do have Time Intelligence already; however,
this is something different for the reporting purposes.

Thanks,
Paul

"Deepak Puri" wrote:

Quote:
Why not try adding Time Intelligence (included with the Business
Intelligence Wizard):

http://msdn2.microsoft.com/en-us/library/ms175440.aspx

Defining Time Intelligence Calculations using the Business Intelligence
Wizard

The time intelligence enhancement is a cube enhancement that adds time
calculations (or time views) to a selected hierarchy. This enhancement
supports the following categories of calculations:

Period to date.

Period over period growth.

Moving averages.

Parallel period comparisons.
...



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


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.