Quantcast
Channel: SQL Server Analysis Services forum
Viewing all articles
Browse latest Browse all 14337

MDX - previous 3 months aggregate

$
0
0

Hi -

I have a calc that isn't working the way I want. For March 19, I would like to see the aggregate of Dec 18 - Feb 19, For Feb 19 I would like to see Nov 18 - Jan 18 and so on.

This calc works for the first month (March) but fails for the rest

divide(
SUM
(
   [Time].[Fiscal Mo].CurrentMember.Lag(3) :
   [Time].[Fiscal Mo].CurrentMember,
   [HOD Product Family Gp 1 Sales]-[HOD Product Family Gp 1 Drp Shp Sales]
)
,
SUM
(
   [Time].[Fiscal Mo].CurrentMember.Lag(3) :
   [Time].[Fiscal Mo].CurrentMember,
   [HOD Product Family Gp 1 Sales])
)

I have a calculation for the divide step in the example above labeled as HOD % Grp1

Ideally I would like to have the below, but couldn't get that to work either:

Aggregate
(
   [Time].[Fiscal Mo].CurrentMember.Lag(3) :
   [Time].[Fiscal Mo].CurrentMember,
   [HOD % Grp1]
)


Viewing all articles
Browse latest Browse all 14337

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>