1
votes

I have two dimension properties "Project Start" and "Project End" that belong to my [Project] dimension. They stand for the start and end date of my projects. Now I want to use these values with MDX, or to be more precisely, in an IIF statement in my query. I want to now if one or both properties are after or before some parameters (projectstart ([Time].[Year - Month - Day].[Month].&[2012-01-01T00:00:00]) and projectend).

So I started to try things like this:

  • Format([Project].[ParentProject].CURRENTMEMBER.PROPERTIES("Project End"), "yyyy-mm-dd") > StrToMember("[Time].[Year - Month - Day].[Month].&[2012-01-01T00:00:00]")
  • [Time].[Year - Month - Day].[Month].&[2012-01-01T00:00:00].MEMBER_KEY > [Project].[ParentProject].CurrentMember.Properties("Project End")
  • CDate([Time].[Year - Month - Day].[Month].&[2012-01-01T00:00:00].MEMBER_KEY) > CDate([Project].[ParentProject].CurrentMember.Properties("Project End"))

But either I get an error or the wrong case of the IIF-statement is executed. After chechkig up MSDN what I get from "[Project].[ParentProject].CurrentMember.Properties("Project End")" I'm more than confused now. On the one hand it says that I will get a string, but on the other hand (if there is a TYPED in the property definition) I should get back the data type of the value (in this case DateTime). I wonder what is right now and/or if I understood the MSDN wrong.

Maybe somebody can help me to clear that up and give me a hint how I can work with these properties.

1

1 Answers

1
votes

Okay, after spending some more time on finding the answer I have changed my MDX query quite a lot. This resulted in the fact, that I ended up with a query including the Format function and "yyyy-mm-dd" as aiming format. But the conversion didn't work and said, that it can't convert my property value into a date. The returned value of the property was at least for a human recognisable as a date (I wrote a simple MDX query to have a look at what I get).

So obviously the data type of a dimension property seems really to be a string.