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(dimension); 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 this 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;
ElmCount = DIMSIZ(sDimName);
WHILE(iElm < ElmCount);
  Loop Guts
  iElm = iElm + 1;

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

DimSiz can be used in either Rules or TI processes

If you like this post, please spread the love…

About John

Managing Director of Infocube. We are a management accounting consultancy that specialises in Business Analytics.
This entry was posted in Elements, Rule Functions, TI Functions and tagged DIMSIZ, WHILE. Bookmark the permalink.