@COUNT

Returns the number of data values in the specified data set (expList).

Syntax

@COUNT (SKIPNONE | SKIPMISSING | SKIPZERO | SKIPBOTH, expList)
ParameterDescription

SKIPNONE

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

SKIPMISSING

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

SKIPZERO

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

SKIPBOTH

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

expList

Comma-delimited list of member specifications, variable names, functions, or numeric expressions.

Notes

The @COUNT 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

See Also

  • @RANGE