ssas

How to use UNION in MDX

大兔子大兔子 提交于 2019-12-02 09:46:00
I want to UNION the below MDX query. For these two queries measures and dimensions are different for the same date range. Please help me to get out of this. SELECT NON EMPTY { [Measures].[Number of es2] } ON COLUMNS, NON EMPTY { ([Date].[Year].[Year].ALLMEMBERS * [Date].[Month].[Month].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM ( SELECT ( [Date].[Date Hierarchy].[Date].&[20170101] : [Date].[Date Hierarchy].[Date].&[20180101] ) ON COLUMNS FROM ( SELECT ( { [PracHistory].[Name].&[In] } ) ON COLUMNS FROM [Cube])) WHERE ( [PracHistory].[Name].&[In] ) SELECT

AMO OLAP QueryBinding

限于喜欢 提交于 2019-12-02 09:42:18
Depending on business logic sometimes I need to change source table for my Customer dimension in Cube. Previously I was changing structure of cube using the following code: MyServerDataSourceView.Schema.Tables["DimCustomers"].ExtendedProperties["QueryDefinition"] = "new query"; MyServerDataSourceView.Update(); // update to new definition DimCustomer.Process(ProcessType.ProcessAdd, EF); MyServerDataSourceView.Schema.Tables["DimCustomers"].ExtendedProperties["QueryDefinition"] = "old regularquery"; MyServerDataSourceView.Update(); // revert back to old definition But it is not trustful.

C# amo get roles complete

雨燕双飞 提交于 2019-12-02 09:40:41
I'm working on a SSAS project in which I, amongst other things, need to get a complete list of users for a tabular cube, in C#. Currently I have it working in such a way that I can get the roles, but the data is incomplete. When I call the Server.Database.Roles (simplified for readability) property and enumerate through it I only get ID, Name and CreatedTimeStamp. What I am missing, which is crucial, is Members, CellPermissions (DAX Filters) and the permissions for those members. The permissions (read/write/administrator) I am currently looking for in Server.Database.Cube but the

MDX - TopCount plus 'Other' or 'The Rest' by group (over a set of members)

╄→гoц情女王★ 提交于 2019-12-02 08:30:26
问题 I've got requirement to display top 5 customer sales by customer group, but with other customers sales within the group aggregated as 'Others'. Something similar to this question, but counted separately for each of customer groups. According to MSDN to perform TopCount, over a set of members you have to use Generate function. This part works ok: with set [Top5CustomerByGroup] AS GENERATE ( [Klient].[Grupa Klientow].[Grupa Klientow].ALLMEMBERS, TOPCOUNT ( [Klient].[Grupa Klientow]

SSAS Aggregation on Distinct ID

回眸只為那壹抹淺笑 提交于 2019-12-02 07:41:10
I wish to change the default aggregation from SUM to SUM on Distinct ID Values. This is the current behaviour ID Amount 1 $10 1 $10 2 $20 3 $30 3 $30 Sum Total = $90 By default, I am getting a sum of $90. I wish to do the sum on distinct ids and get a value of $60. How would I modify the default Aggregation Behavior to achieve this result? Design your data as a many-to-many relationship: create one table/view having one record per ID and the amount column from the data shown in your question (the main fact table), and one table/view having one record per record of your data as shown in your

Search AllMembers of User Hierarchy - for corresponding Set return a related members from upper and lower levels

折月煮酒 提交于 2019-12-02 07:33:33
We have a user hierarchy with 3 levels (Level1 being the upper level - Level3 the lower) Using the FILTER function I state a string, this string could be within the member_name of any member from any (or several) of the levels. This returns a set. I would then like all members from the hierarchy related to each item in the set; both upper and lower levels. I've also tried (unsuccessfully) to include a column that is always Level2 in the results as a reference and also an ordering column. WITH MEMBER [Measures].[LevelName] AS [DimensionX].[HierX].Level.Name MEMBER [Measures].[LevelNumber] AS

MDX SSRS Parameter category chooses all sub category

家住魔仙堡 提交于 2019-12-02 07:04:22
I have been looking all over stackoverflow for this and I can't figure it out. So I have a dataset using a SSAS cube, and it has two parameters. It has a category and subcategory. I already created the datasets to populate these parameters and they work fine when I select them both. The way my report runs is that it is a collection of subreports in a table and it is grouped by the category and sub grouped by the subcategory. So When I select the category parameter, it lists each sub category for all the sub reports. What I am trying to do is getting a total of all the subcategories within that

Search AllMembers of User Hierarchy - for corresponding Set return a related members from upper and lower levels

為{幸葍}努か 提交于 2019-12-02 06:51:14
问题 We have a user hierarchy with 3 levels (Level1 being the upper level - Level3 the lower) Using the FILTER function I state a string, this string could be within the member_name of any member from any (or several) of the levels. This returns a set. I would then like all members from the hierarchy related to each item in the set; both upper and lower levels. I've also tried (unsuccessfully) to include a column that is always Level2 in the results as a reference and also an ordering column. WITH

MDX - TopCount plus 'Other' or 'The Rest' by group (over a set of members)

别来无恙 提交于 2019-12-02 05:10:55
I've got requirement to display top 5 customer sales by customer group, but with other customers sales within the group aggregated as 'Others'. Something similar to this question , but counted separately for each of customer groups. According to MSDN to perform TopCount, over a set of members you have to use Generate function. This part works ok: with set [Top5CustomerByGroup] AS GENERATE ( [Klient].[Grupa Klientow].[Grupa Klientow].ALLMEMBERS, TOPCOUNT ( [Klient].[Grupa Klientow].CURRENTMEMBER * [Klient].[Klient].[Klient].MEMBERS , 5 , [Measures].[Przychody ze sprzedazy rzeczywiste wartosc] )

Force mdx query to return column names

喜欢而已 提交于 2019-12-02 01:59:54
问题 When connecting from powerpivot to SSAS, I got the following problem - if for some reason no rows are returned by mdx query, no column names are returned either and powerpivot gives an error. When executing such a query in SSMS I got 0 rows if mdx returns nothing and 2 rows if mdx returns 1 row (column names and the row itself). So - can I somehow force SSAS to return column names? Query currently looks a bit like this: SELECT NON EMPTY {[Measures].[Measure1]} ON COLUMNS, NON EMPTY {Filter(