mdx

VBA Reptitive MDX query to Analysis Services

守給你的承諾、 提交于 2019-12-08 02:47:46
问题 I have a report where I run the same MDX query each week, and paste the results in a worksheet to then generate a report. I know how to connect to the OLAP cube in excel, but I don't like manipulating the pivot table to match my query. I'd like to use VBA to connect to the cube and and return the results of the specific query in a worksheet as a values paste, or table. I can save the MDX query in a seperate sheet. Would this be possible? I'm new to VBA, so I'm not sure where to get started.

AdventureWorks date dimension shows different results depending on selected hierarchy

风格不统一 提交于 2019-12-06 21:49:05
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 EMPTY { [Measures].[Internet Sales Amount]} ON 0, NON EMPTY { [Date].[Month of Year].&[1] } ON 1 FROM

How to automate MDX testing of SSAS

自古美人都是妖i 提交于 2019-12-06 15:32:25
I've developed some MDX queries which are used to test our SSAS cube. I would like to automate these queries so that I could execute them all with a click of a button and ideally green bar/red bar based on their output. Is there a way I could hook these queries up with Visual Studio to get this behavior? You can try any unit testing framework here. Although unit tests aren't intended for such use, they can be useful there - test runners have red/green indicator out of the box. Write test which executes mdx using ADOMD.NET ( http://j.mp/NtKFih ) and exception during execution will fail test.

Creating a Calculated Time Periods Hierarchy

倾然丶 夕夏残阳落幕 提交于 2019-12-06 15:27:19
In order to give a nicer Cube browsing experience to end users, I am trying to create a Time Periods hierarchy consisting of Calculated Members. Currently I have used a Calculated Column in my DSV to create a column with the same value on every row in my Dates table (value is All Time ). Then within my Date and Time dimension I have created a single level, single member hierarchy using that Calculated Column, which looks like this: Now what I have already successfully done is add Time Periods to my Calendar hierarchy with the following calculation: CREATE MEMBER CURRENTCUBE.[Completion Date].

Calculated measure/dimension

你。 提交于 2019-12-06 12:02:40
I'm relatively new to MDX and am trying to accomplish what I think should be an easy thing, but I haven't found any solution. I have a sales cube and one of the measure is profit which can be negative or positive. I want to get one measure which is effectively the sum of positive profit, i.e. only include in the new measure those profit numbers that have a positive profit. The trick here is this is on the row detail level and something like WITH MEMBER Measures.PositivePNL as IIF (Measures.PNL > 0, Measures.PNL,0) doesn't work as that only works with the aggregate number I should have

MDX syntax for DAX measures calculated with AVERAGE()

折月煮酒 提交于 2019-12-06 07:17:20
I have the following expression in Excel that works fine. =CUBESET("ThisWorkbookDataModel", "TopCount( [ProductBV].[Product Name].Children,10, sum( ( [Calendar].[Week Ending].[All].[1/6/2013]:[Calendar].[Week Ending].[All].["&TEXT($E$2,"m/d/yyyy")&"], [ProductBV].[Moderation Status (ALL)].[All].["&$E$3&"] ), [Measures].[Product Review Count] ) )", "Top 10 to date") The Product Review Count measure using the following DAX formula. Product Review Count:=COUNTROWS(ProductBV) However, when I change the DAX measure to one that utilizes an AVERAGE function (Product Avg Review), the CUBESET function

WHERE clause in calculated member

╄→尐↘猪︶ㄣ 提交于 2019-12-06 00:58:06
I am facing some problem to calculate values from comparing dimension's value. I have 3 dimensions (Datatype, Customer, Product) and one measure (GrossSales). What would be the MDX query if I want GrossSales for ProductID = 1,2,3 and Dataype = 4,5,6? Here Datatype has relationship with GrossSales, Customer has relationship with GrossSales and Product has relationship with Customer. I am trying this but doesn't work CREATE MEMBER CURRENTCUBE.[Measures].Forecast_Gross_Sales AS ( SELECT NON Empty [Measures].[Gross Sale] FROM [Measures] WHERE ( [Data Type].[ID].[ID] = 4 AND [Chain].[Customer ID] =

SSAS Dimension attribute as Calculated Measure

不羁的心 提交于 2019-12-05 22:33:29
I am having some issues trying to implement an average of a dimension attribute. The basic structure is: Booking Header Dimension Fact Table (multiple rows per Booking Header entry) On the booking header dimension I have a numerical attribute called Booking Window, and I want to be able to create a calculated measure that averages this value. We are using SQL Server 2012 standard edition. Any help would be greatly appreciated. The best approach would be to create a measure group from the dimension table (in BIDS, go to cube designer, tab "Cube Structure", right-click the cube object in the

Adding Adomd parameters programmatically C#

南笙酒味 提交于 2019-12-05 03:54:11
问题 Afternoon all. I'm building a web app and I'm attempting to pull through some data from an SSAS cube. I have the following MDX I would like to replicate in c# but with adding a few parameters i.e. two parameteres, one for company 123 and another for location 1: @"SELECT NON EMPTY([Dim Unit].[All Units].[Category Group Name]) ON COLUMNS FROM [Info] WHERE ([Dim Company].[All Companies].&[123], [Dim Location].[All Locations].&[123]&[1])"; Now, I can get this up and running with one parameter:

MDX ignoring Excel filter

牧云@^-^@ 提交于 2019-12-04 15:33:58
I'm just starting to get my head around MDX and I'm having trouble with a calculated member. I'm using the following MDX: IIF( ISEMPTY((Axis(1).Item(0).Item(0).Dimension.CurrentMember, [Measures].[Qty])) ,NULL ,([Product].[Product Code].CurrentMember.Parent, [Measures].[Qty]) ) What I'm trying to do is get a total quantity of the group of products displayed in a cube. I then use that total to divide by each product's quantity to get a "percent of total" measure. The above MDX does correctly return the total quantity of products displayed in any dimension. However, when a user in Excel changes