PDA

View Full Version : Retrieve Current Year With Mondrian MDX



Fauzul Azmi
10-31-2008, 04:39 AM
Hello somebody,

pls help
I have mdx query :
select {[Measures].[Customer],[Measures].[Target Customer]} ON COLUMNS, NON EMPTY (
ORDER(CROSSJOIN({[Time].[2008)]},{[Time].[Month].Members}), [Time].[Month].Ordinal,ASC)) ON ROWS FROM [BIAS]

currently .. at part [Time].[2008] still hardcoded.
How can I retrieve current year value from server ?

Thanks in advance

iso.smd
10-31-2008, 05:38 AM
Hi

the MDX function CurrentDateMember() should do the job.
You can also experiment with Now()

Greetings
Philipp

Fauzul Azmi
11-06-2008, 09:58 PM
Hi

the MDX function CurrentDateMember() should do the job.
You can also experiment with Now()

Greetings
Philipp
Thanks Philip I wil try this

Regards

Fauzul Azmi
11-06-2008, 10:06 PM
Hello all pls help

I want to show number of customer on last year, last month (current year), and current year.
I've written mdx query as bellow :
WITH
MEMBER [Measures].[Customer Last Year] as '([Measures].[Customer], [Time].[2007].[Q2].[5])'
MEMBER [Measures].[Customer Previous Period] as '([Measures].[Customer], [Time].[2008].[Q2].[4])'
MEMBER [Measures].[Customer Current Period] as '([Measures].[Customer], [Time].[2008].[Q2].[5])'

SELECT {[Measures].[Customer Last Year], [Measures].[Customer Previous Period], [Measures].[Customer Current Period]} ON COLUMNS,
NON EMPTY{[Zone].CurrentMember.Children} ON ROWS
FROM [BIAS]

The problem is : when I checked the result. Only true for number of current year customer. the others aren't correct. pls advice....thanks in advance

Regards,
Azmi

feristhia
01-09-2009, 01:49 AM
Hi Fauzul,

You can use PrevMember mdx function. For example, you can see my wiki article at :

http://pentaho.phi-integration.com/mondrian/mdx-menghitung-pertumbuhan-penjualan-tiap-periode

It's in Indonesian though.

Regards,

Feris