none
Add calculated member in the Cube SSAS

    Pregunta

  • Hi Friends,

    I would like to add one Caluclated member in the Cube. I did like this but it is not working

    When I browse the cube in the filter if I pass week 13 2012

    then the above member needs to sum the stock from business starting to week13 2012

    that means those values are current stock levels.

    Could anyone tell me why that expression is not working .....

    lunes, 02 de abril de 2012 13:53

Respuestas

  • When you create a filter like you did you are generating a sub-select. Sub-selects do not alter the context (ie. they do not set the .currentmember) so you calculated measure will not work - there is no good work around for this.

    If you put the weeks on the rows or columns or create the filter by dragging the attribute to the location which says "drop filter fields here" - your calculation will work (as this filter area puts the filter selection in the WHERE clause of the MDX query).


    http://darren.gosbell.com - please mark correct answers

    martes, 03 de abril de 2012 7:43
  • The measure you have created in the cube should work fine. You just can't query it using sub-selects.

    http://darren.gosbell.com - please mark correct answers

    martes, 03 de abril de 2012 9:11

Todas las respuestas

  • Can your run the following query to see if the measure [Net Move Quantity - Stock] has values at all levels in the hierarchy?

    SELECT [Measures].[Net Move Quantity - Stock] ON 0,
    Time.[Fiscal Hierarchy].MEMBERS ON 1
    FROM <<Cube Name>>


    -Remember to mark as helpful/the answer if you agree with the post.

    lunes, 02 de abril de 2012 20:09
  • Hi

    Thanks For the Post. I try with below Simple MDX for life Total and its working as expected.

    WITH 
     MEMBER [Measures].[Life Total] AS 
      Sum
      (
       {NULL : [Date].[Calendar Weeks].CurrentMember}
       ,[Measures].[Internet Sales Amount]
      ) 
    SELECT 
     {
      [Measures].[Internet Sales Amount]
      ,[Measures].[Life Total]
     } ON 0
     ,{[Date].[Calendar Weeks].[Calendar Week].MEMBERS} ON 1
    FROM [Adventure Works];

    Try Below link which help you.

    Date range problem in MDX query

    Suhas Kudekar


    Mark as Answer if this resolves your problem or "Vote as Helpful" if you find it helpful.

    My Blog
    Follow @SuhasKudekar

    martes, 03 de abril de 2012 5:16
  • When you create a filter like you did you are generating a sub-select. Sub-selects do not alter the context (ie. they do not set the .currentmember) so you calculated measure will not work - there is no good work around for this.

    If you put the weeks on the rows or columns or create the filter by dragging the attribute to the location which says "drop filter fields here" - your calculation will work (as this filter area puts the filter selection in the WHERE clause of the MDX query).


    http://darren.gosbell.com - please mark correct answers

    martes, 03 de abril de 2012 7:43
  • Thanks for your information ... I dont want to write MDX each time to calculate that field.

    thats why I would like to create that field in the Cube itself.

    Any Idea pleaseeeeeeee

    Thanks,

    Rama

    martes, 03 de abril de 2012 8:23
  • Hi Naveen.

    The values for Net Move Quantity Stock is at all levels.

    cant we create calculated member in the Cube based on my above logic.?

    Thanks,

    Rama

    martes, 03 de abril de 2012 8:47
  • The measure you have created in the cube should work fine. You just can't query it using sub-selects.

    http://darren.gosbell.com - please mark correct answers

    martes, 03 de abril de 2012 9:11