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;