dbTalk Databases Forums  

calculate forecast total for final, incomplete week

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


Discuss calculate forecast total for final, incomplete week in the microsoft.public.sqlserver.olap forum.



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

Default calculate forecast total for final, incomplete week - 08-23-2006 , 07:24 AM






Hi Folks,

Just in case anyone finds this handy ::

MDX to find last incomplete week element, then average out measuresI
got data for, and provide an estimate

IIF(
CINT(SUM([Dim Date].[YWD].currentMember, [Measures].[Registrations
Qty])) > 0 AND
CINT(SUM([Dim Date].[YWD].currentMember.lead(1),
[Measures].[Registrations Qty] )) < 1,
CINT(

(SUM([Dim Date].[YWD].firstSibling : [Dim Date Vw].[YWD].lastSibling,
[Measures].[Registrations Qty]) / COUNT([Dim Date
Vw].[YWD].firstSibling : [Dim Date ].[YWD].currentMember) )
* 7

)

, 0)

------

YWD being a Year, Week, Day heirarchy

Bests,

om


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.