mdx

MDX query works but ignores the EXCEPT clause

非 Y 不嫁゛ 提交于 2020-01-25 08:08:00
问题 I have been working on a custom dll (that is called via a custom xll / Excel Addin) to construct MDX and return 2D data. It's working nicely and I just went to work out how I add the ability to send in an exclusion list using EXCEPT. I built up a query with filtering and this query works except it ignores the EXCEPT. Anyone with more MDX than me (I'm about 2 months in haha :)) know why? Thanks Leigh WITH Member [Measures].[Book_Label] AS [Book].[Book].CURRENTMEMBER.MEMBER_CAPTION Member

MDX query works but ignores the EXCEPT clause

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-25 08:06:12
问题 I have been working on a custom dll (that is called via a custom xll / Excel Addin) to construct MDX and return 2D data. It's working nicely and I just went to work out how I add the ability to send in an exclusion list using EXCEPT. I built up a query with filtering and this query works except it ignores the EXCEPT. Anyone with more MDX than me (I'm about 2 months in haha :)) know why? Thanks Leigh WITH Member [Measures].[Book_Label] AS [Book].[Book].CURRENTMEMBER.MEMBER_CAPTION Member

Slow dimension because it had a default member

风流意气都作罢 提交于 2020-01-24 15:44:04
问题 I have an SSAS cube that has a dimension with about 500,000 members. Performance is surprisingly good until I had a default member on one of the attributes (a boolean Yes/No value that we default to Yes). This change makes a refresh go from 5 seconds to over 20 minutes. Are default values known to be bad for performance? I can't really see anything on Google suggesting that they are bad performers. For context, when refreshing a PivotTable, Excel was executing a heap of WITH MEMBER statements

MDX Count over time without specific hierarchy

人走茶凉 提交于 2020-01-16 05:27:51
问题 This follows on from my question about count from start of time. I would like to be able to do the count without basing it on a DateTime Hierarchy, but have this as a calculated measure, which works when you drag a dimension against it. I currently have with member [Measures].[Commitment Total] as sum( [Date Dim].[FY Hierarchy].[Fiscal Year].members(0):[Date Dim].[FY Hierarchy].currentMember , [Measures].[Commitment Count]) Then using the calculation: select [Measures].[Commitment Total] on 0

In MDX, What is the best way to display the member_key of all dimension members?

China☆狼群 提交于 2020-01-16 05:10:13
问题 In the following example, how can I use the "member_key" for displaying the [Ad Name Dim].[Ad Name].[Name].ALLMEMBERS? in other words, to display ALL ads unique IDs instead of it's names ? WITH SET [Selected Measures] AS { [Measures].[Cost] ,[Measures].[Clicks] } MEMBER [Measures].[MinDate] AS Head ( NonEmpty ( [Time Dim].[Time Dim].[Month] //<<to return minimum month but could be changed to a different level ,( [Selected Measures] ,[Ad Name Dim].[Ad Name].CurrentMember ) ) ,1 ).Item(0).Item

MDX CA 2100 Security Issue

大憨熊 提交于 2020-01-16 04:03:49
问题 I have written MDX query and assigned it to Adomd Connection object. When i Run Code Analysis, it gives me CA2100 Review SQL queries for security vulnerabilities error we can't directly supply query to connection objects. It Says either we should embed it in Stored Procedure or use Parametrized query. But in my case, there are no parameters for this query. So kindly help, how can I remove this CA 2100 Security error. PFB the code. Thanks in advance. conn.Open(); // Adomd Connection Object var

Merge 2 MDX queries

北城以北 提交于 2020-01-15 22:49:16
问题 I would like to show outcome of these 2 queries in one table. SELECT {[Measures].[Udzial Wieznia w Aktywnosci Count]} ON COLUMNS, {[Aktywnosc].[Id Wiezienia].Members} ON ROWS FROM [Wiezienia HD2] WHERE [Udzial Wieznia w Aktywnosci].[Id Ucieczki].[2] : [Udzial Wieznia w Aktywnosci].[Id Ucieczki].[101] and SELECT {[Measures].[Udzial Wieznia w Aktywnosci Count]} ON COLUMNS, {[Aktywnosc].[Id Wiezienia].Members} ON ROWS FROM [Wiezienia HD2] First one shows how many escapes from jail there were in

Merge 2 MDX queries

╄→гoц情女王★ 提交于 2020-01-15 22:48:44
问题 I would like to show outcome of these 2 queries in one table. SELECT {[Measures].[Udzial Wieznia w Aktywnosci Count]} ON COLUMNS, {[Aktywnosc].[Id Wiezienia].Members} ON ROWS FROM [Wiezienia HD2] WHERE [Udzial Wieznia w Aktywnosci].[Id Ucieczki].[2] : [Udzial Wieznia w Aktywnosci].[Id Ucieczki].[101] and SELECT {[Measures].[Udzial Wieznia w Aktywnosci Count]} ON COLUMNS, {[Aktywnosc].[Id Wiezienia].Members} ON ROWS FROM [Wiezienia HD2] First one shows how many escapes from jail there were in

Adding OR into the FILTER function

无人久伴 提交于 2020-01-15 08:52:08
问题 We've got the following thanks to @FrankPI in this SO Post WITH MEMBER [Measures].[LevelName] AS [Employee].[Employee Department].CurrentMember.Level.Name MEMBER [Measures].[LevelNumber] AS [Employee].[Employee Department].CurrentMember.Level.Ordinal MEMBER [Measures].[MemName] AS [Employee].[Employee Department].CurrentMember.Name SET [Set_TargetEmp] AS { FILTER( [Employee Department].AllMembers, ( InStr( 1, [Employee].[Employee Department].currentmember.name, "WC4") <> 0 ) ) } SELECT {

AdventureWorks date dimension shows different results depending on selected hierarchy

て烟熏妆下的殇ゞ 提交于 2020-01-14 03:04:14
问题 Here are two simple queries which shows data on month level filtered by dates. In the first query I am using Month level of "Date.Calendar" user hierarchy. SELECT NON EMPTY { [Measures].[Internet Sales Amount] } ON 0, NON EMPTY { [Date].[Calendar].[Month].&[2013]&[1] } ON 1 FROM [Adventure Works] WHERE {[Date].[Date].&[20130105]:[Date].[Date].&[20130106]} And recieved - January 2013 -> $857,689.91 Results In the second query I am using "Date.Month of Year" attribute hierarchy. SELECT NON