@COUNT

The @COUNT calculation function for Essbase returns the number of values in a data set.

This function returns the number of data values in the specified data set (XrangeList).

Syntax

@COUNT (SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH, XrangeList)

Parameters

SKIPNONE

Includes all cells specified in the data set, regardless of their content, during calculation of the count.

SKIPMISSING

Excludes all #MISSING values from the data set during calculation of the count.

SKIPZERO

Excludes all zero (0) values from the data set during calculation of the count.

SKIPBOTH

Excludes all zero (0) values and #MISSING values from the data set during calculation of the count.

XrangeList

A list of numeric values. Referred to generically throughout this topic as "the data set."

Can be a valid member name, a comma-delimited list of member names, cross dimensional members, or a return value from a member set function or range function (including @XRANGE).

For more information about XrangeList, see Range List Parameters in the topic Range and Financial Functions.

Notes

This function always returns an integer greater than or equal to 0.

Example

The following example is based on the Sample Basic database. Assume that the Measures dimension contains an additional member, Prod Count. This example calculates the count of all products for which a data value exists and uses the @RANGE function to generate expList:

FIX(Product)
"Prod Count" = @COUNT(SKIPMISSING,@RANGE(Sales,@CHILDREN(Product)));
ENDFIX

This example produces the following report. Since SKIPMISSING is specified in the calculation script, the #MI values for Diet Drinks are skipped during the product count.

                             Jan     New York
                            Actual      Budget
                            ======      ======
Sales        Colas           678         640
             Root Beer       551         530
             Cream Soda      663         510
             Fruit Soda      587         620
             Diet Drinks     #MI         #MI
              Product       2479        2300
                  
Prod Count   Product          4           4

The following example assumes a Year dimension is added to Sample Basic. It counts data values using cross-dimensional members in the data set.

FIX(Product)
"Count" = @COUNT(SKIPMISSING,@XRANGE("2011"->"Sep", "2012"->"Mar"));
ENDFIX

The above calculation is performed across the following multidimensional range specified by XrangeList:


2011->Sep
2011->Oct
2011->Nov
2011->Dec
2012->Jan
2012->Feb
2012->Mar