Skip to content

Instantly share code, notes, and snippets.

@osya
Created December 13, 2014 17:06
Show Gist options
  • Save osya/86ef7416c24b43ee6f70 to your computer and use it in GitHub Desktop.
Save osya/86ef7416c24b43ee6f70 to your computer and use it in GitHub Desktop.
MDX Level Counts #MDX #BI
--Количество уровней иерархии
WITH
MEMBER [Measures].[NumberOfLevels] AS
[Territory].[Territories]. Levels.Count
SELECT
[Measures].[NumberOfLevels] ON COLUMNS
FROM
[FRGS]
--Общее количество дочерних элементов до определенного уровня
WITH MEMBER [Measures].[ACount] AS
COUNT(DESCENDANTS ([Territory].[Territories].CurrentMember,4))
SELECT [Measures].[ACount] ON 0
, {[Territory].[Territories].&[200001]} ON 1
FROM [FRGS]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment