Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
How to calculate a sum for a rolling period (e.g.; last 7 days)?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Steven H  
View profile  
 More options Aug 23 2006, 11:40 am
Newsgroups: microsoft.public.sqlserver.olap
From: "Steven H" <steven.he...@ilg.com>
Date: Wed, 23 Aug 2006 08:40:01 -0700
Local: Wed, Aug 23 2006 11:40 am
Subject: How to calculate a sum for a rolling period (e.g.; last 7 days)?
If we have a measure that is number of sales orders per day [Sales Order
Count], how would we write an MDX statement that will return the sum of
Sales Order Count for the last "X" days, such that if the cutrrent member is
Monday 8/21/2006 and we want the last 7 days sun, we get sum of Sales Order
Count from 8/15/2007 - 8/21/2006?

Thanks!


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jéjé  
View profile  
 More options Aug 23 2006, 12:39 pm
Newsgroups: microsoft.public.sqlserver.olap
From: "Jéjé" <willgart_A_@hotmail_A_.com>
Date: Wed, 23 Aug 2006 12:39:24 -0400
Local: Wed, Aug 23 2006 12:39 pm
Subject: Re: How to calculate a sum for a rolling period (e.g.; last 7 days)?
something like:
sum(
{time.currentmember.lag(7):time.currentmember}, measures.[Sales Order
Count])

"Steven H" <steven.he...@ilg.com> wrote in message

news:OBjtmpsxGHA.3464@TK2MSFTNGP03.phx.gbl...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ZULFIQAR SYED  
View profile  
 More options Aug 23 2006, 9:03 pm
Newsgroups: microsoft.public.sqlserver.olap
From: "ZULFIQAR SYED" <data...@gmail.com>
Date: 23 Aug 2006 18:03:42 -0700
Local: Wed, Aug 23 2006 9:03 pm
Subject: Re: How to calculate a sum for a rolling period (e.g.; last 7 days)?
Steven,

Please try LASTPERIODS function in case you are using AS2005. Here is a
test script against Adventure Works DW in the samples.

with
member measures.x as
sum(
                {
                        lastperiods(
                                7,
                                [Date].[Calendar].[Date].&[629]
                        )
                }
                ,
                [Measures].[Internet Sales Amount]
)
select
{
        lastperiods(
                7,
                [Date].[Calendar].[Date].&[629]
        )

} on 1

,
{
        [Measures].[Internet Sales Amount]
        ,
        measures.x
}

on 0
from
[Adventure Works]

HTH..

ZULFIQAR SYED
HTTP://ZULFIQAR.TYPEPAD.COM


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeje  
View profile  
 More options Aug 23 2006, 9:35 pm
Newsgroups: microsoft.public.sqlserver.olap
From: "Jeje" <willg...@hotmail.com>
Date: Wed, 23 Aug 2006 21:35:46 -0400
Local: Wed, Aug 23 2006 9:35 pm
Subject: Re: How to calculate a sum for a rolling period (e.g.; last 7 days)?
good, this is the function I'm looking for but my memory has decide to not
help me ;-)
lastperiods is more easy to use and to read.

"ZULFIQAR SYED" <data...@gmail.com> wrote in message

news:1156381422.277190.172580@75g2000cwc.googlegroups.com...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google