Has ArrayFilter changed in Pano X from what it was in Pano 6?

I have a field titled ‘EchoCodes’. The current record’s EchoCodes field has “2.111.121” as its data.

In another database ‘703-Codes’, there are 2 fields, ‘Code’ & ‘Description’. A field might have ‘2’ in the Code field, and the Description field might have “Blue”. Another record has ‘111’, and ‘Green’ for their respective values.

When I use the ArrayFilter function like this…

ArrayFilter EchoCodes,gEchoObservations,“.”,lookupselected(“703-Codes”,“Code”,import(),“Description”,“”,0)

I am expecting my gEchoObservations to be an array of ‘Blue.Green. …’.

This has worked fine in Pano 6 but in Pano X, my new array is just “…….”

What changed in Pano X that is preventing this from giving me the result I am expecting?

More… If I change the lookup to ‘lookupselected(“703-Codes”,“Code”,import(),“Description”,“++”,0)’ I get .++.++.++ so the lookupselected is not retrieving as it should. If I verify the lookupSelected in the Formula Workshop with a static value instead of the import(), it works but the whole deal is failing as if the import() is not feeding the correct values.

Looks like import( won’t work as a parameter of lookupselected(. It needs to be a parameter of arrayfilter.

Maybe this would work.

ArrayFilter EchoCodes,gEchoObservations,“.”,ignore("",cache(import(),"theCode"))+lookupselected(“703-Codes”,“Code”,theCode,“Description”,“”,0)

It evaluates import() outside the lookupselected( function, and puts it into a cached variable that is used inside of it.

This works just fine for me. (Panorama X Pro Version 10.2.2, macOS Tahoe 26.0.1 & macOS Sequoia 15.6.1)

Looks like the matching records are not visible. Relacing lookupselected() with lookup() will work unless the matching records are not in the other file.

I am not seeing the arrayfilter function in OP’s example code. I see the Arrayfilter statement… Obviously they are related but they do different things,

You are correct Chris. It is the Statement that I found was not using the import() when it was within the lookupSelected function in Pano X but the import() inside the function did work when using Pano 6.

My previous code in this project which started around 1995, was less than perfect with regards to optimization. Certainly it grew and did later get modified to make use of new statements like ArrayFilter, but the procedure was taking about 1.5 minutes to run which was unacceptable. (~80,000 records, ~200 fields, db file sizes typically ~90 MB, ~10 files in the set.)

It is basically a medical report writer using codes for common sentences and phrases, which are sometimes altered by use of other codes for modifications of adverbs & adjectives, etc. It allows a specialist to specifically detail how the full sheet report should read in about 10 seconds of their time. The input is similar to a large bingo card where the desired numbers can be circled, slashed, or added as might be needed. Many of the default codes are already pre-selected.

I with little enthusiasm started rewriting some of the key parts of the project and am overwhelmed as to the successes that I have had with more efficient methods. No more loops which were terrible on speed. I have phenomenal speed with large formulas. 8,055 characters on the right side of an equal sign! But boy o boy, is it fast.

The verbiage part of the report might have a paragraph that reads something like this…

The study was technically diagnostic. Visceroatrial situs was solitus. Normal systemic and pulmonary venous connections were present. Pulmonary venous connections are normal.
All pulmonary veins drained anomalously to systemic veins above the heart. A patent foramen ovale was present. Both atria were normal in size and configuration. The right atrium was enlarged. The left atrium was mildly enlarged. The right atrium was normal in size and configuration. The mitral valve leaflets were thickened and domed suggesting stenosis. There was an echodense area on the mitral valve suggesting vegetation(s). A mild concentric hypertrophy of the left ventricle was present. The aortic valve appeared bicuspid. The aortic valve leaflets appeared thickened and domed suggesting moderate stenosis. Aortic valve excursion was reduced consistent with moderate stenosis. The left ventricular outflow tract was normal. The ventricular septum was intact. A posterior/inlet septal defect was present. The tricuspid valve appeared normal. The right ventricle was normal in size and function. The right ventricular outflow tract, pulmonic valve and pulmonary artery were normal. The main pulmonary artery appeared normal. No pericardial effusion noted.