DimSiz TM1 Function: Use and Syntax

The TM1 function DimSiz returns the total number of elements in a TM1 dimension.

Syntax of DimSiz

The syntax is 

DIMSIZ ( DimName );

where dimension is the dimension you want to get the total number of elements (note that you may need to prefix the dimension name with the TM1 server name in the syntax servername:dimension).

Use and Example

You would typically use the DimSiz function in to set up a loop so you can then repeat a process as many times as is required to make your way through all elements in a dimension.  For example:

iElm = 1;
DimName = 'Customer';
ElmCount = DIMSIZ(DimName);
WHILE(iElm < ElmCount);
  Loop contents
  iElm = iElm + 1;

This sets up two variables (iElm and ElmCount) and then processes the contents of the loop until iElm equals the number of elements in the dimension.

DimSiz can be used in either Rules or TI processes