Select Sub Table

Description

Submodel Select a sub-table from the given table based on the given step.

If a sub-table corresponding to the given step is not found, the sub-table corresponding to the greatest key smaller than the given step is returned.

Inputs

Name Type Description
Input Table Table Type The table containing the sub-tables corresponding to steps.
Step Real Value Type The input step.

Outputs

Name Type Description
Result Table Type The resulting sub-table.

Group

Notes

This submodel is similar to functor Get Table From Key, except that if a key is not found, it retrieves the sub-table corresponding to the greatest key smaller than the given step. This is the same behavior adopted by functors like Select Lookup Table and Select Transition Matrix. Thus, the use of this submodel is advised as a suitable replacement for that functor family.

The differences between Select Sub Table and Get Table From Key can be seen below:

Key1* Key2* Value1 Value2
1 12 “bbbb” 23
5 12 “cccc” 23
5 11 “bbbb” 14
12 22 “aaaa” 23

Retrieving the sub-table corresponding to Key1 5 returns the following table for both operators:

Key2* Value1 Value2
12 “cccc” 23
11 “bbbb” 14

However, retrieving the sub-table corresponding to Key1 4 fails for Get Table From Key, but returns

Key2* Value1 Value2
12 “bbbb” 23

Internal Name

SelectSubTable