mdx

Linked server dynamic catalog for executing MDX through OpenQuery

允我心安 提交于 2019-12-02 15:43:26
问题 I have multiple OLAP databases in my project, so is it possible to dynamically decide the catalog for executing this MDX query? SELECT * FROM OpenQuery(OLAP_SERVER, 'WITH MEMBER measures.X AS dimensions.count SELECT Measures.X ON 0 FROM MyCube') as X I don't want to create a separate linked server for each of the OLAP database. Both the relational and cube databases reside on the same physical machine. My linked server configuration are: EXEC master.dbo.sp_addlinkedserver @server = N'OLAP

MDX Query to return the number of records

狂风中的少年 提交于 2019-12-02 10:57:48
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. This should get you the count: NonEmpty ( {[Fact Sample].[Sample Reference No].[Sample Reference No].ALLMEMBERS}, ([Dim Material Master].

How to use UNION in MDX

大兔子大兔子 提交于 2019-12-02 09:46:00
I want to UNION the below MDX query. For these two queries measures and dimensions are different for the same date range. Please help me to get out of this. SELECT NON EMPTY { [Measures].[Number of es2] } ON COLUMNS, NON EMPTY { ([Date].[Year].[Year].ALLMEMBERS * [Date].[Month].[Month].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( [Date].[Date Hierarchy].[Date].&[20170101] : [Date].[Date Hierarchy].[Date].&[20180101] ) ON COLUMNS FROM ( SELECT ( { [PracHistory].[Name].&[In] } ) ON COLUMNS FROM [Cube])) WHERE ( [PracHistory].[Name].&[In] ) SELECT

MDX - TopCount plus 'Other' or 'The Rest' by group (over a set of members)

╄→гoц情女王★ 提交于 2019-12-02 08:30:26
问题 I've got requirement to display top 5 customer sales by customer group, but with other customers sales within the group aggregated as 'Others'. Something similar to this question, but counted separately for each of customer groups. According to MSDN to perform TopCount, over a set of members you have to use Generate function. This part works ok: with set [Top5CustomerByGroup] AS GENERATE ( [Klient].[Grupa Klientow].[Grupa Klientow].ALLMEMBERS, TOPCOUNT ( [Klient].[Grupa Klientow]

Trying to calculate quartiles in MDX

心不动则不痛 提交于 2019-12-02 08:28:50
My data looks like this: ID |PersonID |CompanyID |DateID |Throughput |AmountType 33F467AC-F35B-4F24-A05B-FC35CF005981 |7 |53 |200802 |3 |0 04EE0FF0-511D-48F5-AA58-7600B3A69695 |18 |4 |201309 |5 |0 AB058AA5-6228-4E7C-9469-55827A5A34C3 |25 |69 |201108 |266 |0 with around a million rows. The columns names *ID refers to other tables, so they can be used as dimensions. I have an OLAP cube with the column Throughput as Measure and the rest as dimensions. I want to calculate Quartile 1 and 3 of the Throughput measure. I followed this guide: https://electrovoid.wordpress.com/2011/06/24/ssas-quartile/

How to query in mdx between two dates where the date is not exist in the cube

孤人 提交于 2019-12-02 08:26:07
i've some problem in query the data in mdx between two dates DateFrom and DateTo. simplely the problem is, assume we have 3 records of [Year][Month][Day]: [2012][8][21] [2012][8][22] [2012][8][23] if I pass the DateFrom and DateTo as something wasn't in the db, for example DateFrom = [2012].[8].[20] and DateTo = [2012].[8].[24] , it show the error "Mondrian Error:MDX object '[Date].[2012].[8].[20]' not found in cube 'Email'" but if i set DateFrom and DateTo as something in the db, for example DateFrom = [2012].[8].[21] and DateTo = [2012].[8].[23] , it works. because the DateFrom and DateTo

SSAS Aggregation on Distinct ID

回眸只為那壹抹淺笑 提交于 2019-12-02 07:41:10
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? 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 question (the main fact table), and one table/view having one record per record of your data as shown in your

Search AllMembers of User Hierarchy - for corresponding Set return a related members from upper and lower levels

折月煮酒 提交于 2019-12-02 07:33:33
We have a user hierarchy with 3 levels (Level1 being the upper level - Level3 the lower) Using the FILTER function I state a string, this string could be within the member_name of any member from any (or several) of the levels. This returns a set. I would then like all members from the hierarchy related to each item in the set; both upper and lower levels. I've also tried (unsuccessfully) to include a column that is always Level2 in the results as a reference and also an ordering column. WITH MEMBER [Measures].[LevelName] AS [DimensionX].[HierX].Level.Name MEMBER [Measures].[LevelNumber] AS

MDX SSRS Parameter category chooses all sub category

家住魔仙堡 提交于 2019-12-02 07:04:22
I have been looking all over stackoverflow for this and I can't figure it out. So I have a dataset using a SSAS cube, and it has two parameters. It has a category and subcategory. I already created the datasets to populate these parameters and they work fine when I select them both. The way my report runs is that it is a collection of subreports in a table and it is grouped by the category and sub grouped by the subcategory. So When I select the category parameter, it lists each sub category for all the sub reports. What I am trying to do is getting a total of all the subcategories within that

Search AllMembers of User Hierarchy - for corresponding Set return a related members from upper and lower levels

為{幸葍}努か 提交于 2019-12-02 06:51:14
问题 We have a user hierarchy with 3 levels (Level1 being the upper level - Level3 the lower) Using the FILTER function I state a string, this string could be within the member_name of any member from any (or several) of the levels. This returns a set. I would then like all members from the hierarchy related to each item in the set; both upper and lower levels. I've also tried (unsuccessfully) to include a column that is always Level2 in the results as a reference and also an ordering column. WITH