These functions calculate running total/average, up till the current time period Member.
Syntax
YTDSum( <Measure> )
QTDSum( <Measure> )
MTDSum( <Measure> )
Parameters
<Measure> : A Measure or Custom Measure.
Descripion
Returns the running total starting from the beginning of the year|quarter|month up until the current time period Member. The time dimension to be used is automatically determined by the context of the query.
Syntax
YTDAvg( <Measure> )
MTDAvg( <Measure> )
QTDAvg( <Measure> )
Parameters
<Measure> : A Measure or Custom Measure.
Descripion
Returns the running average starting from the beginning of the year|quarter|month up until the current time period Member. The time dimension to be used is automatically determined by the context of the query.
Examples
Consider the following raw data:
| Time | Sales |
| February 1, 2008 | 10 |
| February 2, 2008 | 20 |
| March 1, 2008 | 30 |
| March 2, 2008 | 40 |
| April 1, 2008 | 50 |
Results:
| [Time Month] | [Sales] | YTDSum( [Sales] ) |
| February | 30 | 30 {30} |
| March | 70 | 100 {30+70} |
| April | 50 | 150 {30+70+50} |
| [Time Month] | [Sales] | QTDSum( [Sales] ) |
| February | 30 | 30 {30} |
| March | 70 | 100 {30+70} |
| April | 50 | 50 {50} |
| [Time Month] | [Sales] | YTDAvg( [Sales] ) |
| February | 30 | 30 {30/1} |
| March | 70 | 50 {(30+70)/2} |
| April | 50 | 50 {(30+70+50)/3} |
| [Time Month] | [Sales] | QTDAvg( [Sales] ) |
| February | 30 | 30 {30/1} |
| March | 70 | 50 {(30+70)/2} |
| April | 50 | 50 {50/1} |