mdx

How can I merge two members into one in a query?

半腔热情 提交于 2019-11-30 04:57:55
问题 On rows, I basically want to select all the members of a hierarchy but would like to combine two of them into one. For example, the members would include A , B , and C , so selecting [Group].[Group].members would give me All , A , B , and C but I would like to get All, A, and B&C , where B and C have been merged into one member. Is this possible within a query? The database I'm using stores information about the shipping speed of orders, being small parcel, less than truck load, and white

The best MDX references on the net [closed]

孤者浪人 提交于 2019-11-29 23:57:55
What is the best references/links,cheatsheets for the MDX language? Here are a few starters that I have collected. Please share yours :) http://www.gumper.com/mdx.html http://www.sqlserveranalysisservices.com/OLAPPapers/InventoryManagement%20in%20AS2005v2.htm http://www.ssas-info.com/ssas-cheat-sheets/72-cheat-sheets/880-time-mdx-cheat-sheets I was the only one that knew MDX and had to write these documents for my poor colleagues before I left the company... It's perhaps hard to look through if you don't know what you're looking for, but the Microsoft MDX Reference is actually very good if you

How to learn MDX [closed]

China☆狼群 提交于 2019-11-29 20:49:24
I am currently learning OLAP & MDX after many years of relational database development. Any tips on getting started in MDX? What are the best books and resources to learn MDX? A classic, albeit a bit dated, book is Fast Track to MDX . It's a great overview and a quick read, though it doesn't cover the new MDX features of SQL Server 2005. The Spofford book MDX Solutions is more up date and a little deeper, but a bit harder to get through. I also highly recommend the blogs of Mosha Pasumansky , Chris Webb , and Darren Gosbell . Here is an MDX gentle introduction . I found the Spoffard book not

Top X of Top Y with RestOf member where X and Y are hierarchies from different dimensions

风格不统一 提交于 2019-11-29 17:56:47
This works fine: WITH SET [AllCountries] AS [Country].[Country].MEMBERS SET [AllStates] AS [State-Province].[State-Province].MEMBERS SET [Top2States] AS Generate ( [AllCountries] ,TopCount ( (EXISTING [AllStates]) ,3 ,[Measures].[Internet Order Count] ) ) MEMBER [State-Province].[All].[RestOfCountry] AS Aggregate({(EXISTING {[AllStates]} - [Top2States])}) SELECT {[Measures].[Internet Order Count]} ON COLUMNS ,{ [AllCountries] * { [State-Province].[All] ,[Top2States] ,[State-Province].[All].[RestOfCountry] } } ON ROWS FROM [Adventure Works]; The EXISTING keyword helps a lot . If the two

Getting the Current Day in MDX

↘锁芯ラ 提交于 2019-11-29 10:11:56
摘要:Getting the Current Day in MDX Getting the Current Day in MDX I feel like I don't have the right to write about it after so many bits of information were moving in the web about this subject but I would like to add my point of view (or in fact - my point of code). First of all, I must mention some of those who written about this subject before me. Mosha Pasumansky wrote a long post about it in last may. This post contains some ideas of how to come along with this problem, but none of them is perfect. In fact (as always) - there is no perfect solution for this problem. Another important

Any Python OLAP/MDX ORM engines?

半城伤御伤魂 提交于 2019-11-28 19:01:01
I'm new to the MDX/OLAP and I'm wondering if there is any ORM similar like Django ORM for Python that would support OLAP. I'm a Python/Django developer and if there would be something that would have some level of integration with Django I would be much interested in learning more about it. S.Lott Django has some OLAP features that are nearing release. Read http://www.eflorenzano.com/blog/post/secrets-django-orm/ http://doughellmann.com/2007/12/30/using-raw-sql-in-django.html , also If you have a proper star schema design in the first place, then one-dimensional results can have the following

Logical order an MDX query is processed

亡梦爱人 提交于 2019-11-28 12:52:25
What is the order of evaluation of the clauses within an MDX script? WITH MEMBER measures.A AS ... MEMBER measures.B AS ... SET S1 AS ... SELECT { measures.A ,measures.B ,measures.x } ON COLUMNS {S1} HAVING <condition> on ROWS FROM [Cube] WHERE ({S2}) FROM WHERE WITH SELECT HAVING ? But maybe not that simple as a MEMBER and a SET are dealt with differently in terms of context - so if this order is correct how does context tie in? I would say: FROM (including potential subselects) WHERE SETs and MEMBER location in the WITH clause Build the list of tuples for all query axes (columns, rows, ...)

MDX语法学习(一)filter与iif的使用

三世轮回 提交于 2019-11-27 16:25:05
当我们建好 立方体 之后,就可以使用 MDX语法 大展拳脚,下面我们以一个简单的例子逐步展开 先介绍一下我们的立方体,通过这个例子来学习filter与iif的使用。 我们首先谈需求 需求一:得到 2009 年 5 月,产品 BM00000001 的各城市年累计处方量 需求分析: 度量值:年累计处方量 [Year_Pres_Quantity] 维度: [cust].[City_Name].[City_Name] 条件: [ 月份 ].&[2009-05-01T00:00:00] , [material].[Material].&[BM00000001] 因此,构造我们的 MDX 如下: select [Measures] . [Year_Pres_Quantity] on 0 , non empty [cust] . [City_Name] . [City_Name] on 1 from [ 医院销售分析 ] WHERE ( [ 月份 ] .& [2009-05-01T00:00:00] , [material] . [Material] .& [BM00000001]) 需求二:得到 2009 年 5 月,产品 BM00000001 的各城市 目标医生 的年累计处方量 注意:这里多了一个要求,必须是目标医生的 在我们的传统 SQL 中,这是很容易实现的,我们在 where

Logical order an MDX query is processed

泪湿孤枕 提交于 2019-11-27 07:22:28
问题 What is the order of evaluation of the clauses within an MDX script? WITH MEMBER measures.A AS ... MEMBER measures.B AS ... SET S1 AS ... SELECT { measures.A ,measures.B ,measures.x } ON COLUMNS {S1} HAVING <condition> on ROWS FROM [Cube] WHERE ({S2}) FROM WHERE WITH SELECT HAVING ? But maybe not that simple as a MEMBER and a SET are dealt with differently in terms of context - so if this order is correct how does context tie in? 回答1: I would say: FROM (including potential subselects) WHERE