mdx

SSRS mdx report: use dimension on columns

核能气质少年 提交于 2019-12-11 03:07:18
问题 This simple mdx query do work in SSMS: SELECT CrossJoin({[Measures].[Qnt]}, {[Sales_step].CHILDREN}) ON COLUMNS, [City] ON ROWS FROM [SALES_PIPE] But it fails to run within Visual Studio for rdl report. An error accures: The query cannot be prepared: The query must have at least one axis. The first axis of the query should not have multiple hierarchies, nor should it reference any dimension other than the Measures dimension.. Parameter name: mdx (MDXQueryGenerator) I've found another syntax

Speed up Running Total MDX calculated measure?

允我心安 提交于 2019-12-11 03:03:58
问题 I'm using the follow mdx to keep a running total of the Period Balance measure in my cube: SUM({[Due Date].[Date].CurrentMember.Level.Item(0):[Due Date].[Date].CurrentMember}, [Measures].[Period Balance]) It works great, however it's really slow as the amount of data displayed increases. I can't use a MTD or YTD because the users may be analyzing data that overlaps years. Any way I can speed this up? Thanks in advance. 回答1: I take it you've seen this? http://sqlblog.com/blogs/mosha/archive

MDX - NON EMPTY function faster?

浪尽此生 提交于 2019-12-11 02:53:05
问题 I was under the assumption that NON EMPTY clause must be avoided whenever possible. So, I was in for a shock when I accidentally found that it actually made the query much faster! Sample this: select [Measures].[Count Of Requests] on 0, ([Client].[Client Number].children , [Date].[Year].children) on 1 from [MyCube] --19 seconds on a hot cache select [Measures].[Count Of Requests] on 0, non empty ([Client].[Client Number].children , [Date].[Year].children) on 1 from [MyCube] --5 seconds on a

Escaping special characters in an MDX Query

牧云@^-^@ 提交于 2019-12-11 02:31:01
问题 I'm building a BI dashboard for my client. Our data is stored in an analysis server cube. Overall things work great, but a smartalec tester decided to create a merchant with the name `~!@#$%^&*()_+-=[]{}|;':"<>?,./ The name shows up just fine as a part of a query result, but if the user trys to drill in to the merchant we of course blow up b/c the \ { ; [ " are all part of MDX. Is there a way to escape these characters? I've tried putting a \ in front, or doubling the character. I've searched

MDX: How to Retrieve data Based on Latest Date For Each Student Id

半城伤御伤魂 提交于 2019-12-11 02:29:03
问题 How to get latest count based on date for each id. Attempt: SELECT [Measures].[CourseJoinedCount] ON COLUMNS, NON EMPTY ( [Course].[CourseName].[CourseName], [DimDate].[Full Date].[Full Date], [Student].[StudentId].[StudentId] )ON ROWS FROM [RandD] 回答1: I think the use of Generate might help. Currently untested but I will try an mock this up against AdvWrks tomorrow to see if it works: SELECT NON EMPTY [Measures].[CourseJoinedCount] ON 0, Generate( [Course].[CourseName].[CourseName].MEMBERS ,

To join 2 mdx queries with same hierarchy

僤鯓⒐⒋嵵緔 提交于 2019-12-11 02:06:42
问题 I have 2 mdx queries as: SELECT NON EMPTY { [Measures].[Sum of Sales_Value_USD], [Measures].[Sum of Sales_Value_USD Late] } ON COLUMNS, NON EMPTY { ([DateDimension].[DATE_QUARTER].[DATE_QUARTER].ALLMEMBERS ) } ON ROWS FROM [Model] where ( [DateDimension].[CurrentQuarter].&[Yes], { [ProductLine].[ProductHierarchy] .[Product_Level5].&[PP100 - Electric Solutions], [ProductLine].[ProductHierarchy].[Product_Level5].&[PP200 - Gas Solutions], [ProductLine].[ProductHierarchy] .[Product_Level5].&

MDX - 3rd + dimension example needed

柔情痞子 提交于 2019-12-10 23:31:54
问题 I am trying to learn MDX. I am an experienced SQL Developer. I am trying to find an example of an MDX query that has more than two dimensions. Every single webpage that talks about MDX provides simple two dimensional examples link this: select {[Measures].[Sales Amount]} on columns, Customer.fullname.members on rows from [Adventure Works DW2012] I am looking for examples that use the following aliases: PAGES (third dimension?), section (forth dimension?) and Chapter (fifth dimension?). I have

Using EXCEPT in Calculated member

非 Y 不嫁゛ 提交于 2019-12-10 23:18:16
问题 I have within an MDX query the following calculated member: MEMBER [Asset].[Class].[Fixed Income Derivatives (Inflation Linked)] AS ( [Asset].[Class].&[Fixed Income], [Asset].[Sub Class].&[Derivatives], [Asset].[Sub Class Type].&[Inflation] ) This is used within a query as follows: SELECT { [Measures].[Market Value] } ON 0, NON EMPTY( { [Asset].[Class].[Fixed Income Derivatives (Inflation Linked)] } ON 1 FROM [Asset] This works fine, and of course gives me the market value of all Inflation

How to perform a Distinct Sum using MDX?

亡梦爱人 提交于 2019-12-10 22:15:42
问题 So I have data like this: Date EMPLOYEE_ID HEADCOUNT TERMINATIONS 1/31/2011 1 1 0 2/28/2011 1 1 0 3/31/2011 1 1 0 4/30/2011 1 1 0 ... 1/31/2012 1 1 0 2/28/2012 1 1 0 3/31/2012 1 1 0 1/31/2012 2 1 0 2/28/2011 2 1 0 3/31/2011 2 1 0 4/30/2011 2 0 1 1/31/2012 3 1 0 2/28/2011 3 1 0 3/31/2011 3 1 0 4/30/2011 3 1 0 ... 1/31/2012 3 1 0 2/28/2012 3 1 0 3/31/2012 3 1 0 And I want to sum up the headcount, but I need to remove the duplicate entries from the sum by the employee_id. From the data you can

SSAS - Show Measures on Rows

独自空忆成欢 提交于 2019-12-10 21:35:37
问题 I am very new to MDX and SSAS in general. I am trying get all measures and dates in a nice tabular form. So something like: ╔═════════╦══════╦═══════╗ ║ Measure ║ Date ║ Value ║ ╠═════════╬══════╬═══════╣ ║ Meas1 ║ D1 ║ 3 ║ ║ Meas1 ║ D2 ║ 8 ║ ║ Meas1 ║ D3 ║ 9 ║ ║ Meas2 ║ D1 ║ 7 ║ ║ Meas2 ║ D2 ║ 4 ║ ╚══...════╩═══..═╩═══...═╝ I thought of doing a cross join on the rows axis, but not sure what to put on the columns axis. Any suggestions? 回答1: You can put the default member of any hierarchy that