LOOKUP doesn't work if the keydata is type CHOICES


#1

LOOKUPs fail if the keydata is of type “choices” and if the key field is of type “integer”. I’m assuming that’s because the comparison is between different data types. Is there a way to convert “choices”(which I am assuming to be text) to an integer number for comparison purposes?


#2

Yes. You just use the val( function.

lookup("Database","KeyField",val(KeyData),"DataField",Default,Level)

#3

Thank you, Dave, for pointing that out.

It’s not the easiest finding that in the Help, which I think is a wonderful resource, but can be difficult to navigate. When typing in “text” or “number” the val( ) function doesn’t show up, unless the “Full Text Search” option is chosen. With that choice, the results list is very long.

It might be useful to have a Function categories such as Text, Numbers, Math and Date in addition to the Database and System Info categories that already exist.


#4

The Help file has many separate categories to which you can limit the displayed items. Click on the down arrow in the top left search area.

The drop down list will only display items associated with your selection


#5

Gary,

I’ll refer to the graphic you so kindly provided.

When choosing Formulas:Functions there are 852 entries. Then, searching for “convert” using Full Text Search (FTS) yields 162 entries.

Similarly, choosing Formulas:Text Formulas yields 232 entries. Then, searching for “convert” using FTS yields 68 entries. Alternatively, searching Text Formulas for “number” with FTS yields 137 entries.

All other options in the Help dropdown Formulas category (Operators, Math, Dates, Time, Boolean, etc) have significantly fewer choices, typically 25 or less.

It would help if an AND search could be carried out in the Help find field, or if a further subcategorization of the text functions could be implemented.

Eric


#6

I guess Jim has just given us way too much stuff. :laughing: