CellGetN
CellGetN retrieves a value from a numeric cube cell.
This function is valid in TM1® TurboIntegrator processes only.
Syntax
CellGetN(Cube, e1, e2 [,...en]);
Argument |
Description |
---|---|
Cube |
The name of the cube from which you want to retrieve a value. |
e1,...en |
Dimension element names that define the intersection of the cube containing the value to be retrieved. Arguments e1 through en are sequence-sensitive. e1 must be an element from the first dimension of the cube, e2 must be an element from the second dimension, and so on. These arguments can also be the names of aliases for dimension elements or TurboIntegrator variables. If any of the dimensions in your cube use hierarchies, you can also use the
|
Example of CELLGETN and variables
When this function is used in a conditional statement (IF
), the statement is the
portion containing the condition, not the entire conditional block. After a minor error, execution
continues with the next statement. TurboIntegrator processing has no knowledge that it was in a
conditional once the minor error is processed, so the next statement is the next line, not the line
after the ENDIF;
.
To avoid this situation, use variables for any operation that could encounter a minor error and then use the variables in the conditional statement.
V1 = CELLGETN('PNLCube', 'fred','argentina','Sales','Jan');
IF(V1 = 454);
ASCIIOUTPUT('bug.txt', 'if logic not working properly');
ENDIF;
Example of CellGetN without hierarchies
This example illustrates a function that uses simple element names as arguments and does not reference any hierarchies. It retrieves the numeric value at the intersection of the Actual, Argentina, S Series 1.8L Sedan, Sales, and Jan elements in the Sales cube.
CellGetN('Sales', 'Actual', 'Argentina', 'S Series1.8L Sedan', 'Sales', 'Jan');
Example of CellGetN referencing multiple hierarchies
This example illustrates a function that references multiple hierarchies in the Model dimension. It retrieves the numeric value at the intersection of the Actual, Argentina, S Series (from the vehicles hierarchy in the model dimension), 2.8 Litre (from the enginesize hierarchy in the model dimension), and Jan elements in the Sales cube.
CellGetN('Sales', 'Actual', 'Argentina',
('vehicles':'S Series', 'enginesize':'2.8 Litre'), 'Sales', 'Jan');