Using the Current/Cur Keyword in a Text Function
You can use the current
keyword with certain text functions to make the formulas more dynamic, more useful, and less redundant. The current
keyword can replace required parameters in text functions. Hard-coded parameters produce the same results, whereas the current
keyword can produce dynamic values. For example, when you use current
for the Page parameter in a multiple page grid, it produces the value for each page.
You can use any form of the current
keyword; current
, or cur
. Current
keywords are not case-sensitive.
Note:
The current
keyword is supported in a text object only when using the following text functions: MemberName
, MemberAlias
, and MemberDescription
, where current
specifies the Page dimension parameter. However, the Grid name, Row, and Column must be defined, where applicable, and cannot use the current
keyword.
Example 1:
In the GetCell
function, many of the parameters are or may be relative to the current cell in which the function is entered. Therefore, the current
keyword can be applied to this function. The GetCell
function uses the following syntax:
<<GetCell ("GridName", Row, Column, Page)>>
In the following example, the hard-coded parameters for GetCell
return the same cell value of Grid 1, cell 1A, page 1 across multiple pages:
<<GetCell ("Grid1", 1, A, 1)>>
The next example uses the current
keyword with the GetCell
function. The cell where the function is entered displays different values for each page. Notice that the current
keyword is also applied to the grid name. If the grid name is changed, the text formula is still correct.
<<GetCell ("current", 1, current, current)>>
Example 2
When you use the current
keyword in a cell that expands, the results are relative to the expanded cell.
The following example uses GetCell
functions in an expanded cell (Column A expands to columns Qtr1, Qtr2, Qtr3 and row 1 expands to rows East and West). Text Row 1 uses the current
keyword for the Column parameter; Text Row 2 uses a hard-coded value for the Column parameter.
Name | Description |
---|---|
. |
Qtr1, Qtr2, Qtr3 |
East, West |
# |
Text Row 1 |
|
Text Row 2 |
|
The results are displayed in the following table.
Name | Quarter 1 | Quarter 2 | Quarter 3 |
---|---|---|---|
East |
5,120 |
4,502 |
7,304 |
West |
3,405 |
2,300 |
4,462 |
Text Row 1 |
5,120 |
4,502 |
7,304 |
Text Row 2 |
5,120 |
5,120 |
5,120 |
-
Text Row 1 uses the
current
keyword for the Column parameter, which results in the update of the current column of each expanded cell (Qtr1, Qtr2, Qtr3). Also, because thecurrent
keyword is used for the Page parameter, the values in Text Row 1 update each page relative to the current page of the grid. -
Text Row 2 uses a hard-coded value for the Column parameter (A), which results in the same value of 5,120 for all quarters. A hard coded reference to a Column parameter returns the same top left value of the column and row.
Table -11 Text Functions that Support the Current Keyword
Text Function | Example |
---|---|
Parameters where applicable:
|
Note: The current grid name is used. |
Parameters where applicable:
|
Note: The value from the third (expanded) row of row 1 is shown.
Note: The value from the second (expanded) column of column A would be shown. |
Use the following in a data row or column heading:
Use the following in a non-data row or column heading:
Use the following parameter where applicable:
|
Note: Returns the name of the member of the data row, column, or page that corresponds to the dimension where the heading cell is located. This can be used with the |
Note: The parameters allowing the |
|
Note: The parameters allowing the |
|
Note: The parameters allowing the |
|
Note: The parameters allowing the |
|
Parameters, where applicable:
|
Note: The dimension name corresponding to the heading cell is shown. |
Parameters where applicable:
|
Note: In the above examples, all headings in column A and row 1 are shown for the current page.
Note: The heading in column A is shown for the dimension that corresponds to where the heading cell with the formula is located.
Note: If used within a row text cell, the result is all of the headings in the current column separated by a " - ". This allows users to repeat column headings after a manual page break. |
*Use of the current keyword for the parameter
"reference " is limited. The current keyword
cannot be used in the GetHeading function when it is
entered as a "custom heading" in a row or column because circular
reference is created. You can use the current keyword
as the third parameter within a cell that is part of a text row or
column which is not in the heading area of the grid. For example, if you
add the following formula in cell A3 where row 3 is a text row:
<<GetHeading(cur,cur,cur,1)>> , the
result is the first heading of column A. You can use the GetHeading
function within a heading cell. However, the reference
parameter should not use the current keyword. For
example, when you enter in the heading cell of column B
<<GetHeading(cur, cur, A, cur)>> , the
column A heading is returned.
|