mdx

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

别来无恙 提交于 2019-12-02 05:10:55
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].CURRENTMEMBER * [Klient].[Klient].[Klient].MEMBERS , 5 , [Measures].[Przychody ze sprzedazy rzeczywiste wartosc] )

Force mdx query to return column names

喜欢而已 提交于 2019-12-02 01:59:54
问题 When connecting from powerpivot to SSAS, I got the following problem - if for some reason no rows are returned by mdx query, no column names are returned either and powerpivot gives an error. When executing such a query in SSMS I got 0 rows if mdx returns nothing and 2 rows if mdx returns 1 row (column names and the row itself). So - can I somehow force SSAS to return column names? Query currently looks a bit like this: SELECT NON EMPTY {[Measures].[Measure1]} ON COLUMNS, NON EMPTY {Filter(

Force mdx query to return column names

六月ゝ 毕业季﹏ 提交于 2019-12-02 00:55:41
When connecting from powerpivot to SSAS, I got the following problem - if for some reason no rows are returned by mdx query, no column names are returned either and powerpivot gives an error. When executing such a query in SSMS I got 0 rows if mdx returns nothing and 2 rows if mdx returns 1 row (column names and the row itself). So - can I somehow force SSAS to return column names? Query currently looks a bit like this: SELECT NON EMPTY {[Measures].[Measure1]} ON COLUMNS, NON EMPTY {Filter([DimLocalDate].[Date].&[20110101]:[DimLocalDate].[Date].&[20120101], [JobStatus].[JobStatus].&[1] } ON

Intersection in MDX

試著忘記壹切 提交于 2019-12-01 09:30:49
I recently ran into a problem in our SQL Server 2008 Analysis Services Cube. Imagine you have a simple sales data warehouse with orders and products. Each order can be associated with several products, and each product can be contained in several orders. So the data warehouse consists out of at least 3 tables: One for the Products, one for the Orders and one for the reference table, modelling the n:n relationship between both. The question I want our cube to answer is: How many orders are there which contain both product x and product y? In SQL, this is easy: select orderid from dbo

Best Way to Access MS Analysis Services Cube from Java

百般思念 提交于 2019-12-01 06:05:14
I want to issue MDX against a MSAS cube from a Java client. What connectivity approaches have proven to be reliable for this? FWIW I'm using olap4j as the Java client against a MSAS server fronted up by msmdpump.dll. Seems so far to work OK. Check out http://mondrian.pentaho.org/ . This is an OLAP sever with MDX/XMLA support. I understand that what you need is a client but check in the JSP examples that comes with the sever. One example involve MDX queries over XMLA and I think this should give you a start. 来源: https://stackoverflow.com/questions/518527/best-way-to-access-ms-analysis-services

Any MDX query within Excel vba?

强颜欢笑 提交于 2019-12-01 01:12:11
is there any way to execute MDX query within Excel VBA? I thought that it can be done through ADO , similarly as in SQL case (yes, I'm aware that SQL is different than MDX - issue which was mentioned many times on Stackoverflow). Unfortunately I can't find any examples. Some told about using external tools to accomplish this task, but I don't want to pay for them. Some give an examples in XMLA, but I want to execute simple MDX query instead . Terry Bochaton We have the following generic function that's called in VBA that based on an input MDX string, writes the data to excel. The spreadsheet

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

别来无恙 提交于 2019-11-30 20:51:39
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 glove. I would like to merge small parcel and and less than truck load so I can get aggregate data across

Any MDX query within Excel vba?

早过忘川 提交于 2019-11-30 20:42:03
问题 is there any way to execute MDX query within Excel VBA? I thought that it can be done through ADO, similarly as in SQL case (yes, I'm aware that SQL is different than MDX - issue which was mentioned many times on Stackoverflow). Unfortunately I can't find any examples. Some told about using external tools to accomplish this task, but I don't want to pay for them. Some give an examples in XMLA, but I want to execute simple MDX query instead . 回答1: We have the following generic function that's

The best MDX references on the net [closed]

亡梦爱人 提交于 2019-11-30 11:06:35
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . What is the best references/links,cheatsheets for the MDX language? Here are a few starters that I have collected. Please share yours

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

对着背影说爱祢 提交于 2019-11-30 09:58:25
问题 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].