Show TOC

Background documentationDecision Table Optimization

 

The decision table is the most popular and frequently used of all the expression types offered by BRFplus, and experience shows that customers tend to build up very complex tables with dozens of columns and thousands (sometimes tens of thousands) of rows. Complexity is of course a threat to performance. Therefore, BRFplus offers some tools that help you condense the table content and optimize the table arrangement for better performance. These tools are available in the Additional Actions menu:

  • Rearrange

    The purpose of this function is to help you shift all table rows containing unspecified cells to the bottom of the table. This is to make sure that the more specific conditions in a table are processed first.

    When you execute this function, you are first prompted to define a sort priority for the table columns. By default, the system processes the columns from left to right. For each column, the system determines the unspecified cells and moves the corresponding rows to the bottom of the table. Rows that have already been shifted remain at their position, whereas rows that are shifted due to unspecified cells in lower priority columns are shifted on top of the already shifted rows, but underneath the rows with specified cells.

    Example Example

    In this example, you can see the effect of the Rearrange function. The table to be rearranged has unspecified cells at position A5 and B3.

    Table in initial state

    #

    A

    B

    1

    P100

    1

    2

    P300

    0..2

    3

    P100

    <...>

    4

    P300

    2

    5

    <...>

    3

    6

    P200

    3

    Table after rearranging with default sort priority (A, B)

    #

    A

    B

    1

    P100

    1

    2

    P300

    0..2

    4

    P300

    2

    6

    P200

    3

    3

    P100

    <...>

    5

    <...>

    3

    In the first stage, the system analyzes column A and finds an unspecified cell in row 5, so row 5 is moved to the table bottom. After column A has been processed, the system continues with column B. Here, an unspecified cell is found in row 3. The system moves row 3 down, but one row above row 5 that has already been moved to the bottom. All other rows remain at their original position.

    Table after rearranging with changed sort priority (B, A)

    #

    A

    B

    1

    P100

    1

    2

    P300

    0..2

    4

    P300

    2

    6

    P200

    3

    5

    <...>

    3

    3

    P100

    <...>

    With the changed sort order, the system starts with column B. Consequently, row 3 is now moved to the table bottom, and row 5 is moved to the position one row above the already moved row 3.

    End of the example.
  • Merge Rows

    With this function, you let the system analyze a set of rows to find out whether it is possible to cover the conditions defined in different rows by one single row. If the system finds a suitable solution, it creates a new row containing the combined conditions and deletes those rows whose conditions have been joined in the new row. This function requires that all selected rows have the same result data value assigned, and that at least two rows are selected.

    Example Example

    You want to condense a table as much as possible. For this, you select all rows of the following table and choose Start of the navigation path Additional Actions Next navigation step Merge Rows End of the navigation path.

    Table in initial state

    #

    A

    B

    Result

    1

    P100

    1

    high

    2

    P100

    2

    low

    3

    P100

    <...>

    high

    4

    P100

    3

    high

    5

    P100

    4

    high

    6

    P200

    3

    high

    Table after merging

    #

    A

    B

    Result

    1

    P100

    1; 3..4

    high

    2

    P100

    2

    low

    3

    P100

    <...>

    high

    6

    P200

    3

    high

    After the merge, table rows 1, 4, and 5 have been condensed into row 1. Rows 4 and 5 have been deleted. The remaining rows cannot be merged for the following reasons:

    • Row 2 has a different result than the other rows.

    • Row 3 has an unspecified cell that cannot be combined with specific values.

    • Row 6 has a different value in column A.

    End of the example.