Page 1 of 1

Including Region in a Census title

Posted: 13 Feb 2021 11:39
by phende
I am trying to replace census flags with expressions. A difficulty is getting the expression to identify if the census is for the UK or, for example, Canada. Canada is easily identified as the census record title includes what has been entered in Place. However, I do not include United Kingdom in UK place names. I think I now have to either edit all my census titles to add UK, or write a separate set of expressions for each country of the UK. Could I suggest that Nick changes the title so that it automatically includes UK if one of the UK countries is selected from the pull-down menu? The title would then read Census UK Year ... and make the expressions simpler.

Peter

Re: Including Region in a Census title

Posted: 13 Feb 2021 12:22
by jbtapscott
Could you not use the IF function when creating the Source Title name?. For example (and this is not country related I know), my source title is

{KEYPERSON.SN_GN.CAPS} - {YEAR} {COUNTRY} =IF[=EQUALS[{YEAR}%1939]%Register%Census].

The IF function can be nested so I would think you could handle the individual countries you wanted (although personally, I would want to retain England, Wales, etc in the title!)

Re: Including Region in a Census title

Posted: 13 Feb 2021 15:29
by phende
I am sorry, but I don’t know what this piece of code does. I want to show a census icon on diagrams. This used to be done using flags, and AS used to allow you to choose different flags for different regions. This has now been removed and we must use expressions to call up the icon, using the source record generated by AS. The title seems to be the obvious field to use and I usually accept the one AS generates. I could create a set of expressions for each of the UK countries but they would all call up the same icon for each year. It would be neater if they were all identified as UK, though having UK (England), etc in the title would also do the job.

Peter

Re: Including Region in a Census title

Posted: 13 Feb 2021 15:42
by ChrisRead
The flags option is still available, as I still use it to include census year flags on diagram boxes. I am planning to change to expressions, but not got round to it. So, any existing use of Record flags you have should still work as they did prior to V7. I Last week added a WW1 Death flag to put a poppy under the box for WW1casualties.

Re: Including Region in a Census title

Posted: 13 Feb 2021 16:42
by jbtapscott
Sorry, Peter I thought you were trying to adjust the Source Title to include UK rather than the separate English, Wales, etc text.

Re: Including Region in a Census title

Posted: 13 Feb 2021 18:56
by NickWalker
If you edit the Method 1 census title under the options and replace where it says {COUNTRY} with the following, then for England, Wales and Scotland it will add , UK on the end.

{COUNTRY}=IF[=OR[=EQUALS[{COUNTRY}%Scotland]%=OR[=EQUALS[{COUNTRY}%Wales]%=EQUALS[{COUNTRY}%England]]]%, UK%]

e.g. If you usually use the default method 1 title then you could replace it with this:

{SOURCETYPE} {YEAR} {COUNTRY}=IF[=OR[=EQUALS[{COUNTRY}%Scotland]%=OR[=EQUALS[{COUNTRY}%Wales]%=EQUALS[{COUNTRY}%England]]]%, UK%] {REF} ({OTHER})

I hope this helps

Nick

Re: Including Region in a Census title

Posted: 13 Feb 2021 22:02
by phende
Ah! Thanks, Nick. Light dawns. I don't know enough about these scripts to create my own but I can usually follow what they try to do. I take it that {COUNTRY} is what is selected from the Region pull-down (incidentally, the associated tip says County) so that is just what I want. I had virtually decided just to add UK or USA manually to the title.

Peter

Re: Including Region in a Census title

Posted: 13 Feb 2021 22:27
by NickWalker
It's a bit of a complex title template because of all the 'nested' =OR functions. Although not particularly well publicised, all the auto-text template keywords and functions can be used in the title templates. Yes the Region field was labelled Country in earlier versions - hence the keyword being {COUNTRY}

Thanks for pointing out the County typo (which will now be fixed in the next version).

Nick