The lookup table used in the
previous examples serves to illustrate the essential behaviour of all lookup tables. However, it is worth noting that this particular sample can be improved upon. Similar results can be achieved by deleting two of the five entries, configuring another not to return a value and defining a default value for the table, as shown below. Of course, with this approach the lookup table is guaranteed to return a match every time (meaning that example 5 would instead return a value). Be careful when declaring a lookup table as having a default value. In example 5, an input value of 39 is invalid (the domain of day values is 0 through 6) and in this case it may be more appropriate to return no match.
With the structure shown above, if either an incoming "Day" value is not in the range 1 to 5 or an incoming "Hour" value is not any of 7, 8, 9, 10, 16, 17 or 18 then the lookup table's default value ("False" in this case) is returned.