Page 1 of 1
Diagram Icons: Flags -> Expressions
Posted: 16 Jun 2017 14:08
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"))
Re: Diagram Icons: Flags -> Expressions
Posted: 16 Jun 2017 14:58
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")))
Re: Diagram Icons: Flags -> Expressions
Posted: 16 Jun 2017 15:13
by RogerF
Many thanks, Jane.
Re: Diagram Icons: Flags -> Expressions
Posted: 16 Jun 2017 15:16
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" ) )
Re: Diagram Icons: Flags -> Expressions
Posted: 17 Jun 2017 08:03
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.
Re: Diagram Icons: Flags -> Expressions
Posted: 17 Jun 2017 09:14
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.