Lookups Fail to Match when a Match Exists

Issue #527 resolved
David Thompson created an issue

A simple lookup( that should be finding a match returns the default when there is a default parameter, and a "lookup( function failed to match" error when there is none.

I get the same error if I deliberately get the name of the key field or data field wrong, so I can't tell if it is failing to recognize the match when it sees it, or it's not looking in the right field. It might even be looking for the field in the wrong database.

Comments (6)

  1. Jim Rea repo owner

    @david_thompson_ I assume you must have set up a file or files to test this -- any chance you could send it/them to me?

  2. David Thompson reporter

    I just grabbed a couple of files that were handy, and ran the test in the Formula Workshop, then in a form which I subsequently deleted. When I tried to create a set of demo files just now, the function worked correctly. Then I remembered that the test fields I had originally used both had two word names. The demo files just had the default A and B names. When I changed the names to two word names, it failed in Pan X, and worked in Pan 6. My new demos, with the two word names have been attached.

  3. Kurt J. Meyer

    In my tests the lookup function fails when field names contain spaces or hyphens, but it works with field names containing underscores _ .

  4. Jim Rea repo owner

    The lookup( function now works correctly if the key field name contains a space or other unusual punctuation. Fixes issue #527. Thanks to David Thompson making it easy to track this problem down.

    → <<cset aaf25efa5930>>

  5. Jim Rea repo owner

    The lookuplast(, lookupselected(, lookuplastselected( and table( function would not work if there was spaces or other punctuation in the key field name. This was already reported and fixed for the lookup( function, but I didn't notice that the fix was also needed for these other functions. Fixes issue #527.

    → <<cset e32e0e0d4237>>

  6. Log in to comment