## Parallel Periods and Relative Times ????

### Parallel Periods and Relative Times ????

Hello there,

How do I make a MDX that shows me the following results in relative times?
Sample:

Today
Yesterday
Last Month
Last Quarter
Last Year
Same Month Last Year
etc etc etc

Im using ParallelPeriod function with the following sintax

PallelPeriod([?Level?[, ?Numeric Expression?[, ?Member?]]])

How do I get the last date on a Time dimension? o replace it in the
<<Member>> parameter??

Thanks!!!

### Parallel Periods and Relative Times ????

you can change the default member of your time dimension.
or you can create a calculated member "current day" like this :

strtomember("[Time].[" + format(Now()) , "YYYY\.\[M\]\.\[D\]"))

result of the formula :
[Time].[2002].[3].[15]

> Hello there,

> How do I make a MDX that shows me the following results in relative times?
> Sample:

> Today
> Yesterday
> Last Month
> Last Quarter
> Last Year
> Same Month Last Year
> etc etc etc

> Im using ParallelPeriod function with the following sintax

> PallelPeriod([?Level?[, ?Numeric Expression?[, ?Member?]]])

> How do I get the last date on a Time dimension? o replace it in the
> <<Member>> parameter??

> Thanks!!!

### Parallel Periods and Relative Times ????

--
Saludos,

STAFF Consultant
Grupo MAS - Costa Rica
(506) 233-7133

> you can change the default member of your time dimension.
> or you can create a calculated member "current day" like this :

> strtomember("[Time].[" + format(Now()) , "YYYY\.\[M\]\.\[D\]"))

> result of the formula :
> [Time].[2002].[3].[15]

> > Hello there,

> > How do I make a MDX that shows me the following results in relative
times?
> > Sample:

> > Today
> > Yesterday
> > Last Month
> > Last Quarter
> > Last Year
> > Same Month Last Year
> > etc etc etc

> > Im using ParallelPeriod function with the following sintax

> > PallelPeriod([?Level?[, ?Numeric Expression?[, ?Member?]]])

> > How do I get the last date on a Time dimension? o replace it in the
> > <<Member>> parameter??

> > Thanks!!!

Hi

What's the best way to generate period-to-period comparisons (e.g. for
variance analysis) where you want to generate 2 columns (with different
names, but otherwise similar data-type & values).  For example,

SalesCurrent    SalesPreviousYear    Difference
-------------    -------------------    -----------

The difference column, I can handle in the report writer; that part's easy
enough.

I was going to generate the "current" and "previous" columns from
parameterized stored procedures, since, assuming large data volumes, I don't
want to simply limit a huge, generic View on the (e.g. VB) client front-end.

In Access (with small data volume) I could join two queries in a third
query; but, Transact_SQL doesn't want parameters in Views (bummer  <G> ) ...
and I want to limit the initial recordsets, rather than use a parameterized
stored procedure (step 2) on huge, generic Views (step 1).

Although I have access to SQL Server 2000 (as an MSDN Developer), the data
resides on SQL Server 7 (precluding UDFs ? ).

I'm about to attempt this with "table variables" (i.e. declare variables of
data-type "Table"), but can't find examples in my books ("Guru's Guide to
Transact-SQL"/Ken Henderson, "Programming VB6"/Francesco Balena or the
"Hitchhiker's Guide to VB & SQL Server"/Bill Vaughn).  So, it occurred to me
that I might be approaching it all wrong?

The (spreadsheet) need to generate period-to-period variance comparisons is
so common that I was surprised to find NO Transact-SQL examples on it !!!

thanks, in advance, for whatever insights ...

Michael Coughlin