mdx

MDX - icCube - How to get a DYNAMIC topcount/toppercent with other aggregated?

会有一股神秘感。 提交于 2019-12-10 19:14:17
问题 Using the following mdx, I'm able to retrieve correct data dynamically. create CATEGORY MEMBER [Stats].[Top].[All Etabs].[Top 5 Etablissements] as topcount( [Etablissement].[Etablissement].[Etablissement].allMEMBERS, 5, [Measures].[Nbsejours]),ADD_CHILDREN=true create CATEGORY MEMBER [Stats].[Top].[All Etabs].[Autres Etablissements (>5)] as Except([Etablissement].[Etablissement].[Etablissement].members, TopCount( [Etablissement].[Etablissement].[Etablissement].MEMBERS, 5, [Measures].

Filter Today's Date in MDX

本小妞迷上赌 提交于 2019-12-10 19:04:17
问题 Hi I am trying to put a dynamic date filter (like today's date) in a MDX query, but I cannot get any result from the query, can some one help to check what is it wrong with my query? I first tested the MDX query with a specified dated value, the query is WITH MEMBER [Yesterday] AS VBAMDX.Format(VBAMDX.Now()-1,"MM/dd/yy") select {[Measures].[Order Root Total], [Measures].[Yesterday]} on columns, filter ([D Date].[DAY ID].&[09/19/13], [Measures].[Order Root Total]>0) on rows from [Root Product

MDX Get MAX MEMBER_KEY from Dimension

放肆的年华 提交于 2019-12-10 18:49:23
问题 I have a very simple SSAS dimension which looks like this: Dimension Name: DimKeyword 1 Attribute: Keyword with KeywordID as the KeyColumn and Keyword (name) as the NameColumn Using MDX, I want to get one row with the Max MEMBER_KEY for the DimKeyword dimension (without listing all the Keywords), so far I have: WITH MEMBER KeywordID as [Dim Keyword].[Keyword].currentmember.MEMBER_KEY SELECT {KeywordID} on COLUMNS FROM [Some Cube] Although this seems to only return 0 (which I assume is for the

IN SSAS how to remove null value in distinct count measures

天大地大妈咪最大 提交于 2019-12-10 12:14:27
问题 I have column in fact table .the column in some row has 'Null' value.i have measure based on this column with aggregate function Set to DistinctCount this measure count null value too. but i don't want to count null value what should i do? 回答1: Most efficient would be to filter out NULL values in the data source view (using a named query for example). This won't affect performance too much as a distinct count measure is calculated in a separate measure group anyway. 回答2: One popular solution

MDX - Concurrent calculations based on a “record time range”?

喜欢而已 提交于 2019-12-10 11:39:18
问题 Dear MDX experts, - Is it possible to get the concurrent calculation based on a record time range? Lets say I have; 'start date' , 'end date' , 'used' , and 'color' available... in my fact table.. Is it possible to get the concurrent of 'used' per time (the biggest sum of 'used' that happened during the same range), if yes - what about concurrent used per 'color'? 回答1: To get the sum of all used over a time period, you can use the sum function. Moreover, this will take into account the

Where condition in Mondrian

倖福魔咒の 提交于 2019-12-10 11:02:10
问题 MDX query to find the employee salary more then 5000 select { [Measures].[Total Employee], [Measures].[Total Salary] } on columns, NON EMPTY { ( [Department].[All Department], [Position].[All Position], [Employee].[All Employee]) } on rows from Salary where [Measures].[Total Salary]>5000 My schema <Schema name="Foodmart"> <Cube name="Salary" visible="true" cache="true" enabled="true"> <Table name="employee" alias=""> </Table> <Dimension type="StandardDimension" visible="true" foreignKey=

create a calculated measure in MDX that Filters by Date Range

試著忘記壹切 提交于 2019-12-08 19:27:28
I am trying to create a calculated member to calculate the nb of employees YTD. By YTD I mean the number of employees for any given period of time.My fact table has 2 date dimensions StartDate and EndDate. I would like to calculate YTD employees as follows. Members with StartDate equal to or before current period AND EndDate in the current period OR EndDate is NULL I had a similar task and end up with the following solution: SUM( [EmployeeChanging].[EmployeeChanging].[EmployeeChanging].Members, IIF( [Measures].[EmployeeFrom] <= [Measures].[MaxDay] and [Measures].[EmployeeTo] >= [Measures].

Issue with Order function and Crossoins in MDX

ぃ、小莉子 提交于 2019-12-08 11:21:21
问题 We have a table with one Measure [Discount Amount] on the COLUMNS and CROSSJOIN of [Product].[Product Categories] and [Geography].[Geography] on ROWS axis. We use ORDER function to sort entities by [Discount Amount] with option "BDESC". MDX: SELECT NON EMPTY {[Measures].[Discount Amount]} ON COLUMNS ,NON EMPTY Order ( { Hierarchize ( { CrossJoin ( { Hierarchize ( { [Product].[Product Categories].[All Products] ,[Product].[Product Categories].[All Products].Children } ) } ,{Hierarchize({

How to automate MDX testing of SSAS

心已入冬 提交于 2019-12-08 08:52:29
问题 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? 回答1: 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

Calculating the number of days in a time dimension node - with Grand Total

℡╲_俬逩灬. 提交于 2019-12-08 04:58:38
问题 I need to know the number of days in a time dimension period for calculating weighted averages. I am using the following expression in a calculated measure to obtain the number of days in the current dimension member: Count( Descendants( [Date].[Calendar].CurrentMember, [Date].[Calendar].[Date Key] ) ) This works fine for all drill-down situations, but it does not work for the Grand Total when I have a filter. I suspect that CurrentMember does not work in this situation. It always returns the