Page 1 of 1

Census expression as condition in diagram

Posted: 03 Nov 2022 21:48
by MichaelM
I'm trying to configure a series of census icons within a diagram. The expression that seems to be recommended, eg for 1881, is

Code: Select all

%INDI.CENS[year=1881]%
but that doesn't result in any icon. Could that be because I have different facts for each census, 1881-cen, 1891-cen etc (from a TMG import a few years ago)? Or is there something I'm missing?

Re: Census expression in diagram

Posted: 03 Nov 2022 21:58
by ADC65
That is the correct expression, as I use it successfully in my diagrams.

To ask the obvious, have you actually set an icon to be displayed?

I'm thinking you probably do need a standard CENSUS fact for this to work, rather than a custom fact. But you might want to check that the custom fact does actually have a date set anyway.

Re: Census expression in diagram

Posted: 03 Nov 2022 22:03
by tatewise
Michael, you are correct. The recommended expression is for the recommended standard GEDCOM Census (CENS) event.
That is why it works for Adrian.

Your facts are non-standard custom facts, so those recommendations won't work and you need different expressions.

Would you consider converting all your custom Census facts to use the standard GEDCOM Census event?
The benefits are explained in FHUG Knowledge Base Recording from a Census Record article.
All the FH Census tools and examples in the FHUG Knowledge Base assume the use of the standard Census event.
There is a Plugin that makes the conversion fairly easy.

Re: Census expression as condition in diagram

Posted: 03 Nov 2022 22:46
by MichaelM
Thanks. Yes, it would make sense to make the change, especially as my old TMG census entries made heavy use of roles/shared events. I've actually entered a few new ones now via Ancestral Sources and I see that the expression does work perfectly for those. So, next I need to have a look at the plugin you've suggested - presumably version 1.4 of Give Witnesses Their Own Facts plugin. Will do a full backup first!

Re: Census expression as condition in diagram

Posted: 04 Nov 2022 11:14
by tatewise
That Give Witnesses Their Own Facts plugin will be useful later.
However, it does not produce standard Census (CENS) facts and will make the conversion task slower.

Do all your imported TMG custom Census facts have a valid Date field entered for each fact?
Ideally, it should be the exact Date of the Census for that year.
If not then it would be best to use another plugin to correct all those Dates first. So ask about that before proceeding.
Otherwise, after converting to the standard Census fact, converting the Dates will be a very painful process.

If the Dates are all OK, then you can use the Change Any Fact Tag plugin to produce standard Census facts.

In the Source, select one of your custom Census facts, and in the Target, choose the standard Census fact.
Then use the green button on the right to convert the custom fact to the Census fact.
In the Confirm Edit dialogue click Change all the rest.

Repeat that process for each of your custom Census facts in turn.

If anything is not clear then ask again before doing anything to your Project.