* Complex Query conditions with and, or, ...

Questions about the various ways of sharing your research with others
Post Reply
avatar
egn
Gold
Posts: 23
Joined: 14 Dec 2023 13:19
Family Historian: V7

Complex Query conditions with and, or, ...

Post by egn »

Hi,

I played around with the Query feature and found a problem with complex query conditions using and, or, ... to combine multiple conditions, i.e in the General tab.

Example from manual:

Code: Select all

=Exists(%INDI.BIRT.DATE%) and Not(Exists(%INDI.DEAT.DATE%))
The Add and Update buttons are grayed out.

I have entered this expression in a Text template and pressing Test shows a valid expression.

This works:

Code: Select all

=Exists(%INDI.BIRT.DATE%)
The operator drop-down is shown and it can be added or updated.

Any ideas?

Best
Emil
Last edited by tatewise on 19 Dec 2023 12:19, edited 1 time in total.
Reason: Corrected closing [/code] tag
Emil
User avatar
tatewise
Megastar
Posts: 28506
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Complex Query conditions with and, or, ...

Post by tatewise »

I guess you are referring to the FH Help page for Operators which has a Description and Examples* column.
That * refers to a note hidden at the bottom of the page:
* The examples are all of expressions which can be used as parameters to function calls only. If you want to use these expressions to display values (in a query) you must use a 'wrapper' function such as IsTrue, Calc or Text to provide a context for them to be used.
So in the Query Rows > General tab the Expression box needs to become:

Code: Select all

=IsTrue( Exists(%INDI.BIRT.DATE%) and Not(Exists(%INDI.DEAT.DATE%)) )
Then the Operator box offers is true and the buttons work.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
egn
Gold
Posts: 23
Joined: 14 Dec 2023 13:19
Family Historian: V7

Re: Complex Query conditions with and, or, ...

Post by egn »

Thanks for the Info!
Emil
Post Reply