Can't get superlookup( to work

Using two identical databases, this statement in the primary database:

field «Results field» formulafill superlookup("Target", {«Words2» = ««Words1»»},{«Data to return»},"selected",true(),"wrap",true(),"default","")

… fills every record in Results field with the correct result for the first record in the primary database - every record contains the same result.

Using lookup( terminology, Words2 is the keyfield in the Target database and Words1 is the keydata in the primary database.

Am I doing something wrong or is the function broken?

A little clarification - if both databases are sorted up, it gets the incorrect result in 2 seconds. If they are randomly sorted, it takes 10 minutes to get the same result.

My guess would be that the problem is issue #703. And before you say “but I am not using grabdata(”, you actually are, that is how the double chevron feature works.

I’ll check that out tomorrow. Thanks Jim.

So does this mean that superlookup( is off the menu?

It means that grabdata(, and double chevron notation, is off the table in formulafill, select, and any other statement where a formula is repeatedly evaluated over and over again for each record in the database. That certainly does limit the scope of the superlookup( statement when used with these statements.

Has this been fixed? I have a slightly different problem with superlookup(:

This works as expected:

field Matches1
formulafill superlookup(FileName2, {««Nombre»» contains MNombre1 and ««Nombre»» contains MApellido1},{Cedula},"default","")

But removing the default option:

field Matches1
formulafill superlookup(FileName2, {««Nombre»» contains MNombre1 and ««Nombre»» contains MApellido1},{Cedula})

… gives an error message: “superlookup( function failed to match”. It would appear that the default option is actually a requirement which makes a real mess of what I’m currently trying to do.

I’ve tried using "default",Matches1so that existing values in the Matches1 field will not be destroyed if there is no match but that doesn’t work because the field name is not in double chevrons but, if I put it in double chevrons, I get an error message, “Field or variable «Matches1 does not exist”. How can I specify that existing values should remain unchanged if there is no match?