Row-Based Consolidation Functions
Use row-based consolidation functions to select a record in a record group. You must use row-based consolidation functions within IF-THEN-ELSE statements.
CONSOL_GETROWFIELD
Reads the row identified by a row-based consolidation function and returns the value for the port you specify. You use a numeric argument to specify a port.
You must use the CONSOL_GETROWFIELD function in conjunction with one of the following row-based consolidation functions:
- •CONSOL_MODALEXACT
- •CONSOL_MOSTDATA
- •CONSOL_MOSTFILLED
For each input port in a row-based consolidation function, you must use one instance of the CONSOL_GETROWFIELD function .
Syntax
CONSOL_GETROWFIELD(value)
The following table describes the arguments for this command:
Argument | Required/Optional | Description |
---|
value | Required | Number that indicates an input port in the row-based consolidation function. Use "0" to specify the leftmost port in the function. Use subsequent numbers to indicate other ports. |
Return Value
The value of the port you specify. The function reads this value from a row identified by a row-based consolidation function.
Example
The following expression uses the CONSOL_GETROWFIELD function in conjunction with the CONSOL_MOSTDATA function:
IF (CONSOL_MOSTDATA(First_Name,Last_Name,GroupKey,GroupKey))
THEN
First_Name1 := CONSOL_GETROWFIELD(0)
Last_Name1 := CONSOL_GETROWFIELD(1)
GroupKey1 := CONSOL_GETROWFIELD(2)
ELSE
First_Name1 := First_Name
Last_Name1 := Last_Name
GroupKey1 := GroupKey
ENDIF
In this expression, the CONSOL_MOSTDATA function analyzes rows in a record group and identifies a single row. The CONSOL_GETROWFIELD functions use consecutive numbers to read the port values for that row and write the values to the output ports.
CONSOL_MODALEXACT
Identifies the row with the highest count of the most frequent values.
For example, consider a row that has three ports that contain the most frequent values in the record group. The count of the most frequent values for that row is "3."
You must use this function in conjunction with the CONSOL_GETROWFIELD function. The CONSOL_GETROWFIELD returns the values from the row that the CONSOL_MODALEXACT function identifies.
Syntax
CONSOL_MODALEXACT(string1, [string2, ..., stringN,]
group by)
The following table describes the arguments for this command:
Argument | Required/Optional | Description |
---|
string | Required | Input port name. |
group by | Required | Name of the input port that contains the group identifier. |
Return Value
TRUE for the row that scores the highest count of the most frequent fields, FALSE for all other rows.
Example
The following expression uses the CONSOL_MODALEXACT function to find the row that contains the highest count of the most frequent fields:
IF (CONSOL_MODALEXACT(First_Name,Last_Name,GroupKey,GroupKey))
THEN
First_Name1 := CONSOL_GETROWFIELD(0)
Last_Name1 := CONSOL_GETROWFIELD(1)
GroupKey1 := CONSOL_GETROWFIELD(2)
ELSE
First_Name1 := First_Name
Last_Name1 := Last_Name
GroupKey1 := GroupKey
ENDIF
In this expression, the CONSOL_MODALEXACT function analyzes rows in a record group and identifies a single row. The CONSOL_GETROWFIELD functions use consecutive numbers to read the port values for that row and write the values to the output ports.
CONSOL_MOSTDATA
Identifies the row that contains the most characters across all ports
You must use this function in conjunction with the CONSOL_GETROWFIELD function. The CONSOL_GETROWFIELD returns the values from the row that the CONSOL_MOSTDATA function identifies.
Syntax
CONSOL_MOSTDATA(string1, [string2, ..., stringN,]
group by)
The following table describes the arguments for this command:
Argument | Required/Optional | Description |
---|
string | Required | Input port name. |
group by | Required | Name of the input port that contains the group identifier. |
Return Value
TRUE for the row that contains the most characters across all ports, FALSE for all other rows.
Example
The following expression uses the CONSOL_MOSTDATA function to find the row that contains the most characters:
IF (CONSOL_MOSTDATA(First_Name,Last_Name,GroupKey,GroupKey))
THEN
First_Name1 := CONSOL_GETROWFIELD(0)
Last_Name1 := CONSOL_GETROWFIELD(1)
GroupKey1 := CONSOL_GETROWFIELD(2)
ELSE
First_Name1 := First_Name
Last_Name1 := Last_Name
GroupKey1 := GroupKey
ENDIF
In this expression, the CONSOL_MOSTDATA function analyzes rows in a record group and identifies a single row. The CONSOL_GETROWFIELD functions use consecutive numbers to read the port values for that row and write the values to the output ports.
CONSOL_MOSTFILLED
Identifies the row that contains the highest number of non-blank fields.
You must use this function in conjunction with the CONSOL_GETROWFIELD function. The CONSOL_GETROWFIELD returns the values from the row that the CONSOL_MOSTFILLED function identifies.
Syntax
CONSOL_MOSTFILLED(string1, [string2, ..., stringN,]
group by)
The following table describes the arguments for this command:
Argument | Required/Optional | Description |
---|
string | Required | Input port name. |
group by | Required | Name of the input port that contains the group identifier. |
Return Value
TRUE for the row that contains the highest number of non-blank fields, FALSE for all other rows.
Example
The following expression uses the CONSOL_MOSTFILLED function to find the row that contains the most characters:
IF (CONSOL_MOSTFILLED(First_Name,Last_Name,GroupKey,GroupKey))
THEN
First_Name1 := CONSOL_GETROWFIELD(0)
Last_Name1 := CONSOL_GETROWFIELD(1)
GroupKey1 := CONSOL_GETROWFIELD(2)
ELSE
First_Name1 := First_Name
Last_Name1 := Last_Name
GroupKey1 := GroupKey
ENDIF
In this expression, the CONSOL_MOSTFILLED function analyzes rows in a record group and identifies a single row. The CONSOL_GETROWFIELD functions use consecutive numbers to read the port values for that row and write the values to the output ports.