Count
Returns the number of tuples in a set.
Empty cells are included unless ExcludeEmpty optional flag is used.
Syntax
Count( Set_Expression [ , ( ExcludeEmpty | IncludeEmpty ) ] ) OR Set_Expression.Count
Arguments
Set_Expression | MDX expression that returns set. |
---|---|
ExcludeEmpty | Empty cells are included unless this optional flag is used. |
Examples
Following example counts how many Versions are released in period:
NonZero(Count( Filter( Descendants([Fix Version].CurrentMember, [Fix Version].[Version]), DateInPeriod( [Measures].[Version release date], [Time].CurrentHierarchyMember) AND [Fix Version].CurrentMember.Get("Status") <> "Unreleased" AND ([Measures].[Issues created], [Time].CurrentHierarchy.DefaultMember) > 0 )))
See example report Versions with release date in period in our Demo account. The calculated measure Versions released in period uses the formula above. It counts fix versions with release date in a selected period and if the status currently is not unreleased. The report has another similar measure Unreleased versions in period counting versions in period that are unreleased currently.
See also
- Calculated measures with aggregate functions
- Function Sum() and Filter()
- Import numeric fields as measures to calculate totals automatically