MDX: year-to-date/month-to-date problem

MDX: year-to-date/month-to-date problem

Post by Mike Parr » Fri, 25 May 2001 04:41:08



I am having trouble subtracting the year-to-date totals at the quarter
through the month levels of a time dimension to
calculate the month-to-date totals.

I am using the previousmember and currentmember functions, but I cannot make
the calculation use the year-to-date
totals only at the first member of the level (January for month, 1 for
quarter).  For January, the calculation is taking the YTD amount
for the current year minus the YTD amount from the previous year, obviously
incorrect.

                                                         - Thanks, Mike
Parry (MDX novice)

 
 
 

MDX: year-to-date/month-to-date problem

Post by Tim Graha » Sat, 26 May 2001 15:15:53


I didn't get time to work this out for you but maybe you will find this
article useful:

http://www.sqlmag.com/articles/index.cfm?ArticleID=%2016041&pg=1


Quote:> I am having trouble subtracting the year-to-date totals at the quarter
> through the month levels of a time dimension to
> calculate the month-to-date totals.

> I am using the previousmember and currentmember functions, but I cannot
make
> the calculation use the year-to-date
> totals only at the first member of the level (January for month, 1 for
> quarter).  For January, the calculation is taking the YTD amount
> for the current year minus the YTD amount from the previous year,
obviously
> incorrect.

>                                                          - Thanks, Mike
> Parry (MDX novice)


 
 
 

1. Date Calculations : Period Between 2 Dates (AGE) in Years, Months and Days

Hi,

I'm looking for a Transact-SQL algorithm or Stored Procedure to
calculate a period between 2 given dates (preferably on SQL7.0).

The results that I require are the Years, Months and Days, i.e.

Date 1: 2000/08/01
Date 2: 2002/09/19

Result: 2 (years), 1 (month), 18/(19?) (days)

I've tried with DATEDIFF, the year is correct, but the problem starts
with the days and the months.

Your help will be greatly appreciated.

Regards,

Gremoire

2. If Statement

3. Adding Columns to the output of a Group By Query.

4. Need to find start date of the month and enddate of the month given a date

5. default fields

6. DATE DATE DATE Filemaker and Month names

7. pgsql/src backend/parser/Makefile backend/pars ...

8. Converting 2 char for month and year fields to single date field

9. SQL: How to select date by month and/or year

10. Casting Date datatype to Datetime (Year to Month)

11. Year/Month (only) dates

12. Adding months or years to a date