How market growth for each product under that particular market would be same?

会有一股神秘感。 提交于 2019-12-12 00:36:52

问题


I have All_Product hierarchy in All_product dimension. strength-->product-->market

I want calculation for product growth and market growth on monthly basis((current-prev)/prev). I used scripts to calculate product growth (wrt product) and market growth (wrt market) which working fine but how to show for market growth with respect to each product. eg: market growth for each product under that particular market will be same example:

I have market m1 and under market m1 having products p1,p2 and p3. I have individual product growths and market growths. Question is, when I will go to market to product level then market growth value for products p1, p2, p3 should be same.

If product_growth (m1)=50 and market_growth(m1)=75 and product_growth of p1, p2 and p3 may be 15,25,10 but market_growth for p1,p2,p3 will be 75,75,75

Script I am using for market growth:

SCOPE 
  (
    [Monthly Growth].[VOLUME CALC].&[2.]
   ,Descendants
    (
      [All Products].[All Products].[All]
     ,[All Products].[All Products].[Market]
    )
   ,self
  );
  this = 
    IIF
    (
        Aggregate
        (
          [All Time Periods].[All Time Periods].[Prev_Month]
         ,[Monthly Growth].[VOLUME CALC].DefaultMember
        )
      = 0
     ,NULL
     ,
        (
          Aggregate
          (
            [All Time Periods].[All Time Periods].[Current_Month]
           ,[Monthly Growth].[VOLUME CALC].DefaultMember
          )
        - 
          Aggregate
          (
            [All Time Periods].[All Time Periods].[Prev_Month]
           ,[Monthly Growth].[VOLUME CALC].DefaultMember
          )
        )
      / 
        Aggregate
        (
          [All Time Periods].[All Time Periods].[Prev_Month]
         ,[Monthly Growth].[VOLUME CALC].DefaultMember
        )
    );
END SCOPE;

That means same parent values will flow to their own children as same.

来源:https://stackoverflow.com/questions/33800808/how-market-growth-for-each-product-under-that-particular-market-would-be-same

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!