Error in MDX Calculated Measure syntax in SSAS

Who is online?  0 guests and 0 members
Home  »  Forums   »  microsoft business intelligence   »  bi query languages (mdx, dmx)   » Error in MDX Calculated Measure syntax in SSAS

Error in MDX Calculated Measure syntax in SSAS

Topic RSS Feed

Posts under the topic: Error in MDX Calculated Measure syntax in SSAS

Posted: 11/4/2011

Jedi Youngling 9  points  Jedi Youngling
  • Joined on: 12/10/2010
  • Posts: 2

I have been getting error for the below calculated measure.

CREATE MEMBER CREATECUBE.[Measures].WOP

AS

CASE

WHEN ([Month].[Year].members >= "2011")

then [Measures].[M1]

else [Measure].[M2]

end,

Visible=1;

Scenario - Wen the year is <=2011, measure1 should get displayed else measure2.

wen i hardcode the year ([Month].[Year].&[2011]), it works

Could anyone please help me on this or provide better solution?

 

Thanks in advance!!


Posted: 1/4/2012

Jedi Master 4607  points  Jedi Master
  • Joined on: 10/27/2009
  • Posts: 194

Get this working?  I think you could do this with an immediate IIF statement.

IIF([Month].[Year].members >= 2011,Measures.M1,Measures.M2)


Posted: 4 days ago

Jedi Youngling 43  points  Jedi Youngling
  • Joined on: 2/14/2011
  • Posts: 4

CREATE MEMBER CREATECUBE.[Measures].WOP

AS

IIF([Month].[Year].currentmember.properties("key") <= 2011, [Measures].[M1], [Measures].[M2]),

visible = 1;

Please let me know if this works. Also, note that the key column of the [Year] level should be the year.

Thanks,

Anish


Page 1 of 1 (3 items)