0
在多维数据集中我想根据特定维度和时间段获取度量的平均值,但即使应用总和也返回相同的结果,平均或直接采取测量值,相同的查询如果我运行SQL它返回43行,但在MDX查询它只返回1行。如立方体聚集度量值查询在SQL是MDX作为在多维数据集中我想获得基于特定维度和时间段的度量的平均值
select Measure,[Dimension Name] from datatable where dimension1key=1 and countryKey=2 and regionKey=1 and channelKey=3 and timeperiod between(38,50) groupBy [Dimension Name],Measure
相同的,如果我写
select {[Measure].[price] } on columns,non empty({[Dimension].[Dimanesion Name]}) on rows from (select {[Dimcountry].[country Name].[asia]} on columns from (select {[Dimchannel].[channel Name].[a]} on columns from (select [dimension1].[Dimension1Key].[1]} on columns from (select {[region].[region Name].[abc]} on columns from retaoauditcube))))
只返回一个行作为聚集值
我已经试过均价也不过为立方体返回汇总值,以便其相同和 –
你的意思[措施]。[参考价格] = [措施]。[AVG价格] ?? –
WITH MEMBER [措施]。[av。价格] AS AVG(({[Dim Timeperiod Derived]。[Week Sequence] .CurrentMember,{[Dim Timeperiod Derived]。[Year]。[Year] .Allmembers},{[dim Region]。[Region Name]。[总计ID]} ,{[Dim Channel]。[Channel Name] .Children}),[Measures]。[Price Per Pack])select {[Measures]。[av。价格]},非空{{[Dim Flavor Category]。[Flavor Category TD]。[Flavor Category TD] .ALLMEMBERS)} FROM(SELECT {[Dim Timeperiod Derived]。[Dim Timeperiod Derived]。[Week Sequence ]。&[51]} FROM [dataCube]) –