mdx

MDX Allow member set only siblings in Roles-Dimension Data

寵の児 提交于 2020-01-05 17:49:25
问题 Is it possbile to restrict a Role in Dimension Data by allowing him to see only siblings in the parent-child Hierarchy? Example Hierarchy: EMEA 100 UK 50 London 30 Southampton 20 France 50 Paris 10 Lyon 40 To see only: EMEA 100 UK 50 France 50 回答1: I've received the expected result with the following MDX statement NONEMPTY( descendants( [Dim Branch Hierarchies].[Branch Hierarchy] ,,leaves ) , ( [Measures].[GrantedHi] ,StrtoMember( "([Dim Users].[Account Name].[Account Name].["+ Username()+ "]

Ordering a complex set

◇◆丶佛笑我妖孽 提交于 2020-01-05 09:33:02
问题 I've been playing with a script of Chris Webb's found here: http://cwebbbi.wordpress.com/2007/06/25/advanced-ranking-and-dynamically-generated-named-sets-in-mdx/ The adapted script is this: WITH SET MyMonths AS TopPercent ( [Date].[Calendar].[Month].MEMBERS ,20 ,[Measures].[Reseller Sales Amount] ) SET MyEmployees AS [Employee].[Employee].[Employee].MEMBERS SET MyMonthsWithEmployeesSets AS Generate ( MyMonths ,Union ( {[Date].[Calendar].CurrentMember} ,StrToSet (" Intersect({}, {TopCount

“The restrictions imposed by the CONSTRAINED flag … were violated”

南笙酒味 提交于 2020-01-05 07:58:35
问题 I am new to ssrs .i am creating report which query on cube and provides the result i have used parameter for choosing to and from date and its giving error like "the restriction imposed by constrained flag is violated". what should i do ?i can not remove constrained because production server does not accepts mdx query without constrained. MDX Query is like this:- select {[Measures].[Customers],[Measures].[Contacted Customers], [Measures].[No of Bets], [Measures].[Stakes GBP], [Measures].

MDX - active in current period, and not active in previous period

吃可爱长大的小学妹 提交于 2020-01-04 09:17:30
问题 What is the most efficient way to do this in MDX? I know you can create 2 calculated measures, having active with the time dimension current period selected, and another having the previous period, and then do a filter with a complex condition. However what about other functions which may be more efficient? Any recommendations? My goal is to create a set of calculated measures, which would help customer analysts. The main 2 dimensions, for these are [Calendar], and obviously [Customer]. I

MDX SSAS - Max Date in Measure

萝らか妹 提交于 2020-01-03 14:00:25
问题 Just need to get MAX date in ALL my Measures in the Cube. For instance, DateID is a Dimention , [Measure].[First Measure],...,...,[Second Measure] . How to get list of MAX(DateID) from all Measures in my Cube. 回答1: The following will get you the max date value associated with each measure...but you will have to manually create a calculated member corresponding to each measure. WITH MEMBER [Measures].[Max Date - Internet Sales Amount] AS TAIL( NONEMPTY( [Date].[Date].[Date] ,[Measures].

WHERE clause in calculated member

泪湿孤枕 提交于 2020-01-02 07:25:11
问题 I am facing some problem to calculate values from comparing dimension's value. I have 3 dimensions (Datatype, Customer, Product) and one measure (GrossSales). What would be the MDX query if I want GrossSales for ProductID = 1,2,3 and Dataype = 4,5,6? Here Datatype has relationship with GrossSales, Customer has relationship with GrossSales and Product has relationship with Customer. I am trying this but doesn't work CREATE MEMBER CURRENTCUBE.[Measures].Forecast_Gross_Sales AS ( SELECT NON

SSAS Aggregation on Distinct ID

蓝咒 提交于 2019-12-31 07:13:18
问题 I wish to change the default aggregation from SUM to SUM on Distinct ID Values. This is the current behaviour ID Amount 1 $10 1 $10 2 $20 3 $30 3 $30 Sum Total = $90 By default, I am getting a sum of $90. I wish to do the sum on distinct ids and get a value of $60. How would I modify the default Aggregation Behavior to achieve this result? 回答1: Design your data as a many-to-many relationship: create one table/view having one record per ID and the amount column from the data shown in your

SSAS Aggregation on Distinct ID

◇◆丶佛笑我妖孽 提交于 2019-12-31 07:13:05
问题 I wish to change the default aggregation from SUM to SUM on Distinct ID Values. This is the current behaviour ID Amount 1 $10 1 $10 2 $20 3 $30 3 $30 Sum Total = $90 By default, I am getting a sum of $90. I wish to do the sum on distinct ids and get a value of $60. How would I modify the default Aggregation Behavior to achieve this result? 回答1: Design your data as a many-to-many relationship: create one table/view having one record per ID and the amount column from the data shown in your

MDX Query to return the number of records

岁酱吖の 提交于 2019-12-31 05:18:09
问题 Below is my MDX query SELECT NON EMPTY { [Measures].[Fact Sample Count] } ON COLUMNS, NON EMPTY { ( [Fact Sample].[Sample Reference No].[Sample Reference No].ALLMEMBERS ) } ON ROWS FROM [LIMSInstCube] WHERE ( [Dim Material Master].[Material Master ID].&[999] ) So it gives 10 records as my out put. I have a requirement where I have to show the number of records that are returned from the query i.e 10. Can any one please help me how to get the records count. 回答1: This should get you the count:

MDX Procedure Based on .NET

↘锁芯ラ 提交于 2019-12-31 05:00:52
MDX script in SSAS provides strong functions for multidimensional data analysis, however many problems are hard to solve with MDX actually. Because not all the problems can be cope with MDX script. In other words, these problems will be solved by coding way easily. MDX procedure is supported by all the .NET languages. namespace CustomAnalysisAssembly { public class SPDemo { public static double SalesDifference( double firstVal, double secondVal) { return secondVal – firstVal; } } } The .NET MDX procedure can be used when a assembly that contain the specific procedure is deployed into the