dbTalk Databases Forums  

Urgent: cumulated values / time series / without showing missing values!

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


Discuss Urgent: cumulated values / time series / without showing missing values! in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dr. Parsis Dastani
 
Posts: n/a

Default Urgent: cumulated values / time series / without showing missing values! - 03-09-2006 , 02:00 PM






Hi,
we want to show response values through time.

A campaign has a certain time where responses start and a time where there
are no further responses.
We want to create a table using MDX where only the weeks are shown where we
have measured a response.

Example: Reponse Table given

Campaign 1 Campaign 2
week 12 null null
week 13 10 null
week 14 15 12
week 15 20 14
week 16 null 16
week 17 null null

The result should be the following if Campaign 1 is choosen as the filter:
Resp Cum Resp
week 13 10 10
week 14 15 25
week 15 20 45

The weeks 12 and 16 resp. 17 should NOT be shown since the are no responses
in that week (response = null).
If Camp 2 is choosen the values for week 12, 13 and 17 should NOT been
listed.

Can anyone help me?

Thanks
Parsis
---
Dastani Consulting GmbH
Database Marketing - Data Mining - Customer Relationship Management
Im Westpark 8, 35435 Wettenberg
Tel. ++49 641 98446 16 Fax. ++49 641 98446 29

http://www.dastani.de
dastani (AT) dastani (DOT) de



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

Default Re: Urgent: cumulated values / time series / without showing missing values! - 03-09-2006 , 03:32 PM






Hi Parsis,

Here's a sample AS 2005 MDX query for Adventure Works, which lists
monthly orders and cumulative orders for a particular promotion, but
only for months with orders:

Quote:
With Member [Measures].[CumulativeOrders] as
iif(IsEmpty([Measures].[Order Quantity]), NULL,
Sum(YTD([Date].[Calendar].CurrentMember),
[Measures].[Order Quantity]))
select {[Measures].[Order Quantity],
[Measures].[CumulativeOrders]} on 0,
Non Empty [Date].[Calendar].[Month].Members on 1
from [Adventure Works]
where [Promotion].[Promotions].[Promotion Category].&[Reseller].&[New
Product].&[14]
Quote:

- 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.