dbTalk Databases Forums  

Sum Conditions

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


Discuss Sum Conditions in the microsoft.public.sqlserver.olap forum.



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

Default Sum Conditions - 11-04-2003 , 07:37 AM






How could I do like a "Conditional Summing". For example, I have is a cube
that measures A vendors delivery performace. I do a DateDiff from the
vendor's promise to the actual receipt date. A product promised on 1/1/2003
but doesn't get received until 1/10/2003 has a DateDiff value of 10. If it
were early say 12/25/02 they it would be -7. Well how can I some only the
values that are greater than zero (late) and create an avg for those. So
the measures is actually say when they are late, on avg they are this amount
late.

Hope I provided enough detail.

-mike



Reply With Quote
  #2  
Old   
Tom Chester
 
Posts: n/a

Default Re: Sum Conditions - 11-04-2003 , 11:40 AM






Maybe something like this...

AVG(Filter(Vendor.Vendor.Members, Measures.Diff > 0), Measures.Diff)

tom @ the domain below
www.tomchester.net


"Michael Morse" <mike.morse (AT) micromo (DOT) com> wrote

Quote:
How could I do like a "Conditional Summing". For example, I have is a
cube
that measures A vendors delivery performace. I do a DateDiff from the
vendor's promise to the actual receipt date. A product promised on
1/1/2003
but doesn't get received until 1/10/2003 has a DateDiff value of 10. If it
were early say 12/25/02 they it would be -7. Well how can I some only
the
values that are greater than zero (late) and create an avg for those. So
the measures is actually say when they are late, on avg they are this
amount
late.

Hope I provided enough detail.

-mike





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

Default Sum Conditions - 11-05-2003 , 04:53 AM



Hi,

How to do the conditional Summing.
1.Create a measure for DateDiff
now create another calculated member like below:

iif([Measures].[DateDiff]>0,avg({[Dimension]},[Measures].
[DateDiff]),null)

I think it will work.
Pls try.

Regards,
Vanchi
Quote:
-----Original Message-----
How could I do like a "Conditional Summing". For
example, I have is a cube
that measures A vendors delivery performace. I do a
DateDiff from the
vendor's promise to the actual receipt date. A product
promised on 1/1/2003
but doesn't get received until 1/10/2003 has a DateDiff
value of 10. If it
were early say 12/25/02 they it would be -7. Well how
can I some only the
values that are greater than zero (late) and create an
avg for those. So
the measures is actually say when they are late, on avg
they are this amount
late.

Hope I provided enough detail.

-mike


.


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.