Questions tagged [mdx]

Multidimensional Expressions (MDX) is a query language for OLAP databases. It was developed by Microsoft but has later gained widespread support from other OLAP vendors.

What is MDX?

"Multidimensional Expressions (MDX) is a query language for OLAP databases, much like SQL is a query language for relational databases. It is also a calculation language, with syntax similar to spreadsheet formulas." Source: Wikipedia

It was originally developed as a language for Microsoft's OLAP engine (then called OLAP Services, now renamed Analysis Services) but has since been adopted by a wide range of vendors for use with their OLAP tools.

Resources

Books

3942 questions
5
votes
2 answers

Performance Implications of Calculated Members in SSAS

I'm wondering if there are any performance implications from adding a lot of calculated members to my cube. On one hand, it's nice to have things defined once, located centrally, tested, and available for use from any client which doesn't support…
Dave Bauman
  • 9,252
  • 1
  • 19
  • 19
5
votes
1 answer

MDX Get MAX MEMBER_KEY from Dimension

I have a very simple SSAS dimension which looks like this: Dimension Name: DimKeyword 1 Attribute: Keyword with KeywordID as the KeyColumn and Keyword (name) as the NameColumn Using MDX, I want to get one row with the Max MEMBER_KEY for the…
ToOsIK
  • 643
  • 2
  • 8
  • 18
4
votes
1 answer

Work Item Tree Hierarchy

I have a mdx query to the TFS OLAP like this: SELECT [Work Item Tree].[Work Item Tree Hierarchy].&[269] ON ROWS, {[Measures].[Work Item Count], [Measures].[Microsoft_VSTS_Scheduling_OriginalEstimate], …
Skoraaaa
  • 41
  • 2
4
votes
1 answer

Using Cubeset To Create Top 10 Items List For a Specified Time Period

I am using Excel 2010 to create a list of the top 10 vendors by sales during a specified time period. The catch is that I need to consider only customers that are a member of a particular set. I found this article which has helped me get the Top 10…
Tom
  • 208
  • 1
  • 3
  • 8
4
votes
0 answers

Type mismatch error occurs while casting string values to date type in MDX query with some blank rows

I have a string-type dimension in my SSAS cube having the date values along with some blank values and please find the screenshot for your reference. I am trying to convert these values into Date using the CDate function in the MDX query. I have…
TAMILARASAN R
  • 225
  • 1
  • 6
4
votes
1 answer

How to sort records in MDX query when numeric expression is used with TopCount function

I am trying to sort the Top 201 records in my SSAS cube either ascending or descending based on requirements in my C# code. Here I a using Adventure Works Database, where [Reseller Order Count] is the measure and [Reseller].[Business Type] is the…
Sathish G
  • 91
  • 3
4
votes
1 answer

How do you enforce line length and other formatting rules in MDX?

I would love if there was a way to use the VS Code formatter or prettier to enforce rules like max line length for MDX files. It would make writing blog posts in MDX so much nicer. Does anyone have any methods for doing that? The project I'm…
itwasmattgregg
  • 353
  • 2
  • 8
4
votes
1 answer

Multiple member mdx query returns error (permission to access the specified member)

I want to mention that I'm new to SSAS and MDX. In the past several days I've been dwelling with an excel generated query that errors out. The problem is that a query is generated by excel when trying to read data from an online cube data source…
lerys
  • 61
  • 1
  • 5
4
votes
2 answers

List cross join of two dimensions using MDX or DAX

I have a SSRS report which uses SSAS cube as source and report itself is working fine which includes two parameters as cascaded drop-downs and have multiple values in them. Now i would like to setup a data-driven subscription in report-server where…
ramadongre
  • 95
  • 9
4
votes
1 answer

SQL task MDX with parameters. SSIS

I need to create dynamically some local cubes in ssis and i don't know how to use parameters in this query CREATE GLOBAL CUBE test STORAGE 'C:\test.cub' FROM Cube_test( Measure [Cube_test].[Val], dimension [Cube_test].[Date_1] ( level [Date_1], …
LuisSol
  • 41
  • 2
4
votes
2 answers

Best option to retrieve Anaylysis Services (SSAS) cube data dynamically in ASP.NET MVC

I need to dynamically add/remove dimensions and facts in web application and get results from SSAS. The cube in SSAS is defined and ready to use. So far the best idea I found is use MDX queries to get metadata from SSAS cube and display those data…
azhons
  • 171
  • 1
  • 1
  • 8
4
votes
1 answer

How to get a cube name from the given MDX query

How to get a cube name from the given MDX query. For example: I have a query like as below, SELECT [Date].[Calendar Year].MEMBERS on 0 , TOPCOUNT( [Product].[Product].MEMBERS , 10 , [Measures].[Sales Amount] ) ON 1 FROM [Adventure Works] How can I…
Anand
  • 155
  • 1
  • 1
  • 11
4
votes
1 answer

MDX - How to aggregate by date considering start and end date in a dimension

I need to calculate a measure grouping by date in a range of dates considering a start and end dates in a dimension. The objective is to count the number of students of a specific school that are actives on each day in a period. The following SQL…
4
votes
3 answers

MDX query to get all dates where dateis greater than

For example i am need to take all dates where year is greater than 2013. This code return all dates. SELECT {[Measures].[In]} ON COLUMNS ,Filter ( [Date].MEMBERS , [Date].[Year].CurrentMember > [Date].[2013] ) ON ROWS FROM…
Nodon
  • 967
  • 11
  • 24
4
votes
2 answers

How To Get All Items Created or Still Open For A Given Time

I am working with a system were items are created (postDate dimension) and closed (endDate dimension). The endDate column is always populated with the last time the item was seen. An item is considered closed in a certain time if its last seen date…
wergeld
  • 14,332
  • 8
  • 51
  • 81