* Diagram Icons: Flags -> Expressions

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
User avatar
RogerF
Famous
Posts: 182
Joined: 26 Apr 2009 16:32
Family Historian: V6.2
Location: Oxfordshire, England
Contact:

Diagram Icons: Flags -> Expressions

Post by RogerF »

Currently I have 20 flags of the form 1841 Census and 1841 Missing, controlling the display of appropriately-ordered icons.

I'm experimenting with using expressions to achieve the same result, with only partial success. In place of a flag, I though a Census event with the Place given as "Missing" might work, and indeed the following seems ok:

Code: Select all

=IsTrue(%INDI.CENS[year=1841].PLAC% = "Missing")
My problem is constructing the matching expression to display the alternative (census not missing) flag: ie there is an 1841 census entry where the Place is anything but "Missing". This isn't valid, and I can't spot the error:

Code: Select all

=Exists(%INDI.CENS[year=1841]%) And Not (IsTrue(%INDI.CENS[year=1841].PLAC% = "Missing"))
Roger Firth, using FH to research the FIRTHs of Lancashire and Yorkshire, and the residents of the market town where I live.
User avatar
Jane
Site Admin
Posts: 8508
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Re: Diagram Icons: Flags -> Expressions

Post by Jane »

You need to wrapper the whole lot in IsTrue or FH gets stuck at the and.

Code: Select all

=IsTrue(Exists(%INDI.CENS[year=1841]%) and Not(IsTrue(%INDI.CENS[year=1841].PLAC% = "Missing")))
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
User avatar
RogerF
Famous
Posts: 182
Joined: 26 Apr 2009 16:32
Family Historian: V6.2
Location: Oxfordshire, England
Contact:

Re: Diagram Icons: Flags -> Expressions

Post by RogerF »

Many thanks, Jane.
Roger Firth, using FH to research the FIRTHs of Lancashire and Yorkshire, and the residents of the market town where I live.
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Diagram Icons: Flags -> Expressions

Post by tatewise »

The short answer is that the Expression should be:
=IsTrue( Exists(%INDI.CENS[year=1841]%) And Not(%INDI.CENS[year=1841].PLAC% = "Missing") )

Once you start using And and Or and Not logical operators they must be inside a function such as =IsTrue(...).

However, using the Place name Missing is a novel technique to indicate missing Census details.
I am guessing that you want to only identify as missing, those Census entries when the person is alive.
The way I would suggest is to use the Source Citations, so when there is a completed Census it has a citation, and otherwise it does not.
So the Expressions would be as illustrated in how_to:understanding_expressions|> Understanding Expressions :-
Census completed:
=IsTrue( %INDI.CENS[year=1841].SOUR>_TYPE% = "Census" )
Census missing:
=IsTrue( Exists(%INDI.CENS[year=1841]%) And Not( Exists(%INDI.CENS[year=1841].SOUR%) )
or if there may be a non-Census citation:
=IsTrue( Exists(%INDI.CENS[year=1841]%) And Not( %INDI.CENS[year=1841].SOUR>_TYPE% = "Census" ) )
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
RogerF
Famous
Posts: 182
Joined: 26 Apr 2009 16:32
Family Historian: V6.2
Location: Oxfordshire, England
Contact:

Re: Diagram Icons: Flags -> Expressions

Post by RogerF »

Mike: However, using the Place name Missing is a novel technique to indicate missing Census details.
I am guessing that you want to only identify as missing, those Census entries when the person is alive.
Good guess, but wrong. I have a number of individuals who ought to have census entries for a given year but, try as I might, I can't locate them.

The set of 18** Missing flags is to remind me of instances of this situation; they provide a lightweight method of deliberately marking certain years for certain individuals. Hence my 'novel technique': setting the Census PLACE as "Missing" (a) is simple and deliberate, and (b) would enable me to locate the records for future re-review via a Where Used report on the "Missing" place, in the same way that the Has Flag query does now.

I'm glad I've made the experiment of replacing flags by expressions, but to be honest it doesn't seem to offer any advances in my particular case.
Roger Firth, using FH to research the FIRTHs of Lancashire and Yorkshire, and the residents of the market town where I live.
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Diagram Icons: Flags -> Expressions

Post by tatewise »

You have overlooked the advantage that relates to those Census records you do research and find in the future.
You no longer need to manipulate the 1841 Census, 1851 Census, 1861 Census, et seq Flags.
As soon as you add a Census Event with a Date, Place, and Citation it will automatically satisfy the Expression and any associated Diagram Icons (or anything else using that Expression) will take effect.

I accept that the 18** Missing cases do NOT benefit so much, because setting the Place to Missing is much the same as setting the Flag. BUT there is some benefit, because when you do find the 'missing' Census record, and enter the correct Place and Citation the Missing Expression will NOT be satisfied and the other Expression will be satisfied. So, the benefit is that you do NOT have to remember to clear the 18** Missing Flag, because the Place field itself is acting as the Flag, and that field must change when the Census details change.

That is the fundamental difference between Flags and Expressions.
Flags must always be manipulated by hand, and rely on you making them match your data.
Expressions monitor your data and AUTOMATICALLY take effect depending on that data.
In this case the data you prefer to monitor is the Census Place name, that must reflect the Census data with either Missing or an actual Place name. Entering the Census details is an essential process, possibly via Ancestral Sources, and must be done whether you have Flags or not, but as a side effect changing the data automatically satisfies different Expressions, and that is not the case with Flags.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Post Reply