简体   繁体   English

MDX计算成员固定

[英]MDX Calculated member fixed

i want to ask, if there is some function in MDX language, which returns me a same value in any case.. 我想问一下,是否有MDX语言中的某些功能,无论如何都会返回相同的值。

I created a calculated member, that's indicate how much value was sold on last year. 我创建了一个计算得出的成员,该成员表示去年出售了多少价值。 It's work fine. 很好 But if I in slicer or filter exclude year value of the last year, i get nothing. 但是,如果我在切片器或过滤器中排除了上一年的年值,那么我什么也收不到。 Is there any function, that calculate a value with no filter? 有没有可以不用过滤器计算值的函数吗?

For example, I need function like calculate in DAX in power pivot. 例如,我需要在Power Pivot中使用DAX计算等功能。

Thanks 谢谢

Edit: 编辑:

MDX calculated member for [Mat value]: MDX计算的[垫值]成员:

CREATE MEMBER CURRENTCUBE.[Measures].[MAT value]
 AS SUM([03 Datumy].[MAT].&[MAT],[Measures].[Sales value]), 
FORMAT_STRING = "#,##0.00;-#,##0.00", 
VISIBLE = 1 ,  DISPLAY_FOLDER = 'Sales value' ,  ASSOCIATED_MEASURE_GROUP = '04 Hodnoty'  ;

MDX calculated member for [Mat-1 value]: [Mat-1值]的MDX计算成员:

CREATE MEMBER CURRENTCUBE.[Measures].[MAT-1 value]
 AS SUM([03 Datumy].[MAT].&[MAT-1],[Measures].[Sales value]), 
FORMAT_STRING = "#,##0.00;-#,##0.00", 
VISIBLE = 1 ,  DISPLAY_FOLDER = 'Sales value' ,  ASSOCIATED_MEASURE_GROUP = '04 Hodnoty'  ;

mat2014 http://www.attanon.eu/mat2014.PNG mat2013 http://www.attanon.eu/mat2013.PNG filters http://www.attanon.eu/filters.PNG all http://www.attanon.eu/allmat.PNG mat2014 http://www.attanon.eu/mat2014.PNG mat2013 http://www.attanon.eu/mat2013.PNG 过滤器http://www.attanon.eu/filters.PNG 全部http://www.attanon .EU / allmat.PNG

Edit2: EDIT2:

MAT and MAT-1 is based on column with this value. MAT和MAT-1基于具有此值的列。 I have dimension like this: dimension http://www.attanon.eu/dimension.PNG 我有这样的尺寸: 尺寸http://www.attanon.eu/dimension.PNG

And data looks that: datumy http://www.attanon.eu/datumy.PNG 数据看起来是: 基准http://www.attanon.eu/datumy.PNG

Relationship in [03 Datumy]: [03 Datumy]中的关系:

relations http://www.attanon.eu/relations.PNG 关系http://www.attanon.eu/relations.PNG

The mat is calculated in SQL server. 该垫是在SQL Server中计算的。 Because, i don't have much time to calculate the hiearchy in cube. 因为,我没有太多时间来计算立方体中的层次。

(discussion updates were removed as lack of necessity) (由于缺乏必要,讨论更新已被删除)

UPDATE to fix an issue: 更新以解决问题:

Since your calculation, that determines months belonging to certain month, based on SQL, you can filter-out Date hierarchy by rewriting MAT-measures with adding [03 Datumy].[Year].[All] : 由于您的计算基于SQL确定了属于某个月份的月份,因此您可以通过添加[03 Datumy].[Year].[All]来重写MAT度量,从而过滤出Date层次结构:

CREATE MEMBER CURRENTCUBE.[Measures].[MAT value]
 AS ([03 Datumy].[MAT].&[MAT],[03 Datumy].[Year].[All],[Measures].[Sales value]), 
FORMAT_STRING = "#,##0.00;-#,##0.00", 
VISIBLE = 1 ,  DISPLAY_FOLDER = 'Sales value' ,  ASSOCIATED_MEASURE_GROUP = '04 Hodnoty'  ;

and the same for next one: 和下一个相同:

CREATE MEMBER CURRENTCUBE.[Measures].[MAT-1 value]
 AS ([03 Datumy].[MAT].&[MAT-1],[03 Datumy].[Year].[All],[Measures].[Sales value]), 
FORMAT_STRING = "#,##0.00;-#,##0.00", 
VISIBLE = 1 ,  DISPLAY_FOLDER = 'Sales value' ,  ASSOCIATED_MEASURE_GROUP = '04 Hodnoty'  ;

Actually, it's an equivalent of old SSAS-2000 function .Ignore . 实际上,这等效于旧的SSAS-2000函数.Ignore

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM