ssas

MDX query to count number of product names

…衆ロ難τιáo~ 提交于 2019-12-25 03:44:42
问题 I am new to MDX and trying to count number of product names on a week basis. I have written the below MDX query, but I get all product count as a result. WITH MEMBER [Measures].[Count Of Members] AS Count(Existing [Product Dimension].[ProductName].Members) SELECT {[Measures].[Count Of Members]} ON 0, NON EMPTY { [Date Dimension].[Financial WC] } ON 1 FROM [Cube] WHERE ([Date Dimension].[FinancialYear].&[2018/19], [Sales].[PaymentType].&[Delivery]) I am getting result as : "All 230" as there

Previous Equivalent MTD Across Multiple Months

◇◆丶佛笑我妖孽 提交于 2019-12-25 03:41:08
问题 If today's date is 11 July 2008 then the MTD sum is for the range {01 July 2008 - 11 July 2008}. The previous equivalent MTD period in June is {01 June 2008 - 11 June 2008}. The previous equivalent MTD period in May is {01 May 2008 - 11 May 2008}. I have the following MDX script: WITH MEMBER [Measures].[PrevEquivalentMTD] AS //SUM ( ParallelPeriod ( [Date].[Calendar].[Month] ,1 ,[Date].[Calendar].CurrentMember ) ,[Measures].[Internet Sales Amount] ) MEMBER [Measures].[PrevEquivalentMTD_v2] AS

How to multiply two measures prior to aggregation

浪子不回头ぞ 提交于 2019-12-25 03:27:25
问题 I have two measures. The first is amount, and the second consist of values -1,0 and 1, so table looks like this: Amount Sign -------------- 400 -1 200 1 300 0 Result I want to get is 400*(-1) + 200*1 + 300*0 = -200 , but I am getting (400+200+300)*(-1+1+0) = 0 This is my calculated member: WITH MEMBER [Measures].[Result] AS [Measures].[Sign]*[Measures].[Amount] select [Measures].[Result] on 0, [Time].[Time].members on 1 from [MyCube] 回答1: In you SSAS project, go to the datasource view, for

Calculated Members with multiple Attribute Hierarchy - MDX

瘦欲@ 提交于 2019-12-25 03:27:13
问题 I found this little code where it dynamically calculates TOTAL s for all Dimension/Hierarchy I want. This is close to what I need but will not work for Dimensions that have different number of Hierarchy Levels (Attribute Hierarchy). Current Code only works if there is only one Attribute Hierarchy because of CurrentMember.Parent . I could use CurrentMember.Parent.Parent for Dimension.Hierarchy that have two levels and so on but would not work for the the ones with only one Attribute Hierarchy

SSAS DAX time intelligence previous year and calculation gives wrong value

心已入冬 提交于 2019-12-25 03:26:50
问题 We want to show current periods sales versus previous period sales. To show the previous period we make use of a date dimenion table and the following calculation: CALCULATE(SalesValueGross; DATEADD(Date[Date]; -1; YEAR)) Unfortunately somehow it shows minor (decimal) differences when comparing years. The difference get's bigger when we slice to months. Another issue we have is that this calculation does not seem to work when comparing (for example) week 1 - 2015 with week 1 - 2014. Any help

Grouping MDX query results

三世轮回 提交于 2019-12-25 02:57:20
问题 I have a following query (based on sample data provided with Microsoft® SQL Server® 2008 MDX Step by Step book): WITH SET important_months AS { ([Product].[Product Categories].[Subcategory].&[28].CHILDREN , {[Date].[Month of Year].&[1], [Date].[Month of Year].&[2]}), ([Product].[Product Categories].[Product].&[477] , {[Date].[Month of Year].&[3]}) } SELECT [Measures].[Order Count] ON COLUMNS, important_months ON ROWS FROM [Step-by-Step] The query shows the number of orders placed on products

Connect to SQL Server Analysis Service from Python

馋奶兔 提交于 2019-12-25 02:26:05
问题 I'm using PyODBC for SQL Server 2008 database engine and it works well. I can retrieve records and execute procedures and views with no problem. My issue is I can't connect to SQL Server 2008 Analysis Server using PyODBC. Following list shows what I've tried: cnxn = pyodbc.connect(r'Driver={SQL Server};Server=127.0.0.1;Database=DB1;Trusted_Connection=yes;') And cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=127.0.0.1;DATABASE=DB1;Trusted_Connection=yes;UID=TB\\user;PWD=123123') What's the

SSAS: Can I define a Cube In BIDS, but create/process the partitions in SSMS/SSIS?

徘徊边缘 提交于 2019-12-25 02:14:33
问题 I am new to SSAS, and exploring Partitioning. My data source is very large (web logs):a few hundred million records. I would like to define my cube IN BIDS, and create a SSIS Package to create partitions. For now, I am Generating The MDX to Create & process the partitions, and Executing them in SSMS. I find that this is faster and less error prone them manually creating the partitions using the BIDS UI. I am trying to understand the expected workflow: because every time I go back to BIDS, and

How to use the current visitor's account in SSAS query? [MOSS + PPS + SSAS]

别说谁变了你拦得住时间么 提交于 2019-12-24 21:06:37
问题 I'm using MOSS2010 + Performance Point + Analysis services. Here's the questions: How to get the current visitor's account in PPS report? How to use the current visitor's account in SSAS query? 回答1: This post may help: http://blogs.msdn.com/b/performancepoint/archive/2010/03/25/passing-filter-values-on-the-url-to-performancepoint-services-web-parts.aspx 回答2: Another option is to configure your PerformanePoint 2010 data source to use Per-User Identity . Then access the UserName MDX function:

Power View Fails to Connect

爷,独闯天下 提交于 2019-12-24 20:34:13
问题 When I try to create a Pover View report over my .bism connection I get following error: Original XML rsCannotRetrieveModel400An error occurred while loading the model for the item or data source 'http://localhost/rpl/model.bism'. Verify that the connection information is correct and that you have permissions to access the data source.http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsCannotRetrieveModel&ProdName