Forum Discussion

TheOldPuterMan's avatar
TheOldPuterMan
Brass Contributor
Dec 21, 2022
Solved

Filter with search not returning excepted values

I have a situation where I need to be able to search for data using keyed variables. These range from low and high dates, to accounts, and status codes. There are 3 valid status codes (C, P, and R) I...
  • PeterBartholomew1's avatar
    Dec 21, 2022

    TheOldPuterMan 

    The formula is something of a monster and you might like to consider the use of the LET function to separate the process of selecting the columns you wish to return from that of filtering records.  Assuming the defined names refer to columns of a single table, CHOOSECOLS would offer a more succinct approach to selecting columns and assigning the reduced array to a LET variable.

     

    That aside, it is your use of OR in the filter criterion that I would focus on.  OR returns only a single value when used with array arguments.  The straightforward solution to getting an array of criteria is to use the "+" operator instead.  Otherwise you could use MAP/LAMBDA to combine the two criteria using OR.