3

I am trying to get current date records and I have a query where a particular date is given , how can I put currentdate in that position.

I am new to MDX, if anyone answer that will be really helpful.

Below is the MDX query :

SELECT NON EMPTY { [Measures].[SHC] } ON COLUMNS, NON EMPTY { ([C].[RHC].[rhc].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( { [DHC].[DHC].&[01/01/1992] } ) ON COLUMNS FROM [TABULAR_EAL]) WHERE ( [DHC].[DHC].&[01/01/1992] ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

I want to get records based on CurrentDate.

2 Answers 2

3

Something like this:

StrToMember('[DHC].[DHC].&[' + Format(Now(),'dd/MM/yyyy') + ']')

See my blogpost for more details.

0

I complete the answer :

With Member Measures.CurrentDate As 
Format(
    Now(),
    'yyyyMMdd'
)

Member Measures.GetMemberCurrentDate as
'[Start Date].[Miladi Int Date].&['+ measures.CurrentDate + ']'

member Measures.GetCurrentDateBimehValue as
(StrToMember(Measures.GetMemberCurrentDate) ,[Measures].[BimehValue])


select Measures.GetCurrentDateBimehValue on columns
from [BimehCube]