Page 1 of 1

Is there support for the 'In' function in queries?

Posted: 31 Aug 2021 10:37
by quarlton
Is there a way of using 'In' with a query?
e.g.
Pick up the country name for an event place using =TextPart(%_PLAC%,-1) to get the last element of the Place
Assume that this returns "Australia"

What I would like to test in the query is along the lines of this:

Exclude if "Australia" is in (Australia, New Zealand, Brazil, Russia)

Unfortunately it is not practical to search the Forum for a common word such as "In" so this question may already have been answered.

Many thanks

Re: Is there support for the 'In' function in queries?

Posted: 31 Aug 2021 11:38
by tatewise
Not exactly, but you can use the =FindText(...) function to achieve the same result.
e.g.
Exclude if
=FindText( "Australia, New Zealand, Brazil, Russia", TextPart(%FACT.PLAC%,-1,1,STD), 1 )
is greater than
0

Tip: When looking for row filters don't overlook FH Functions that may offer a workaround:
Visit Understanding Functions and click on Functions (all) to obtain a complete list or New Functions (added in 7.0).

Re: Is there support for the 'In' function in queries?

Posted: 31 Aug 2021 13:30
by quarlton
Many thanks for that Mike.