* censuses - query with different values for an output column
censuses - query with different values for an output column
Hi,
So I've got a query which shows a list of people and what years they have censuses for, for each of the census year, with a 'Y' for each cell they have one. What I'd like to do, is also show which years they shouldn't have a census for - ie before born and after death, if I have that information. So, using a made-up language to show what I mean:
IF data(census-year) OUTPUT "Y"
ELSE IF (census-date < birth-date) OR (census-date > death-date) OUTPUT "-"
I've got the first line, but not the second.
Is this do-able? If so, any clues, please?
Many thanks
So I've got a query which shows a list of people and what years they have censuses for, for each of the census year, with a 'Y' for each cell they have one. What I'd like to do, is also show which years they shouldn't have a census for - ie before born and after death, if I have that information. So, using a made-up language to show what I mean:
IF data(census-year) OUTPUT "Y"
ELSE IF (census-date < birth-date) OR (census-date > death-date) OUTPUT "-"
I've got the first line, but not the second.
Is this do-able? If so, any clues, please?
Many thanks
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: censuses - query with different values for an output column
Yes, it is definitely possible. See FHUG KB Download Kinsfolk Census To Do Table.
It complicates things slightly by checking Census (family) events as well as Individual Census events.
The ATTACHMENT Kinsfolk Census To Do Table goes further by using Estimated Birth & Death dates when actual dates are not available.
BTW: In your screenshot, some Expressions for 1851 and 1871 use [year=11] which is a typo error.
It complicates things slightly by checking Census (family) events as well as Individual Census events.
The ATTACHMENT Kinsfolk Census To Do Table goes further by using Estimated Birth & Death dates when actual dates are not available.
BTW: In your screenshot, some Expressions for 1851 and 1871 use [year=11] which is a typo error.
- Attachments
-
Kinsfolk Census To Do Table.fhq- (35.02 KiB) Downloaded 54 times
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: censuses - query with different values for an output column
Thanks so much Mike, that's great
- and thanks for spotting the typos - oops!
Re: censuses - query with different values for an output column
I've noticed that 1921 is included in the Columns but not in the Rows,
I think (if I've got it right)
needs adding to the Rows of the Kinfolk Census To Do Table (mind-blowing query, by the way
)
I think (if I've got it right)
Code: Select all
=IsTrue((EstimatedBirthDate(%INDI%,EARLIEST,2) > DateAt(1921,6,19)) or (EstimatedDeathDate(%INDI%,LATEST,2) < DateAt(1921,6,19)) or (%INDI.CENS[year=1921].DATE% = DateAt(1921,6,19)) or (%INDI.FAMS>CENS[year=1921].DATE% = DateAt(1921,6,19)) or (%INDI.FAMS[2]>CENS[year=1921].DATE% = DateAt(1921,6,19)) or (%INDI.FAMS[3]>CENS[year=1921].DATE% = DateAt(1921,6,19)) or (%INDI.FAMS[4]>CENS[year=1921].DATE% = DateAt(1921,6,19)))Re: censuses - query with different values for an output column
...and 1921 made visible in the Columns
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: censuses - query with different values for an output column
I probably last updated that Query before the 1921 Census was available and made some preparations for it.
What you have added is perfectly correct.
What you have added is perfectly correct.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: censuses - query with different values for an output column
There is a CensusMissingAges query downloadable from the knowledgebase, which I have modified and which gives a result similar to what you're after.
For each census year, it gives the following entries for each individual:
1. x means not relevant, individual was not alive on census date
2. Blank, individual has a census entry, but age has not been entered
3. Age, age as appears on census
4. find, Alive on census day, but haven't yet found their census entry
The purpose of the query was
a) to find all census entries where I had omitted entering their age from the census.
b) to indicate census entries I still need to find.
see image The formula I used for each column is as follows (adjust for different census years)
=TextIf((%INDI.BIRT.DATE% > DateAt(1841,0,0)) or (EstimatedDeathDate(%INDI%,MID,2) < DateAt(1841,0,0)),"x",TextIf(Exists(%INDI.CENS[year=1841].DATE:YEAR%),%INDI.CENS[year=1841].AGE%," find "))
For each census year, it gives the following entries for each individual:
1. x means not relevant, individual was not alive on census date
2. Blank, individual has a census entry, but age has not been entered
3. Age, age as appears on census
4. find, Alive on census day, but haven't yet found their census entry
The purpose of the query was
a) to find all census entries where I had omitted entering their age from the census.
b) to indicate census entries I still need to find.
see image The formula I used for each column is as follows (adjust for different census years)
=TextIf((%INDI.BIRT.DATE% > DateAt(1841,0,0)) or (EstimatedDeathDate(%INDI%,MID,2) < DateAt(1841,0,0)),"x",TextIf(Exists(%INDI.CENS[year=1841].DATE:YEAR%),%INDI.CENS[year=1841].AGE%," find "))
Mike Loney
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
Re: censuses - query with different values for an output column
Thanks Mike L, I'll give that a look 
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: censuses - query with different values for an output column
Interesting!
Why do you choose to use only explicit Birth Dates instead of Estimated, but do use Estimated Death Dates?
Have you considered the following more compact function instead of the nested TextIf(...) function:
CombineText( , %INDI.CENS[year=1841].AGE%, , " find " )
Also, by using DateAt(1841,0,0) you may be excluding/including some people by mistake.
Why do you choose to use only explicit Birth Dates instead of Estimated, but do use Estimated Death Dates?
Have you considered the following more compact function instead of the nested TextIf(...) function:
CombineText( , %INDI.CENS[year=1841].AGE%, , " find " )
Also, by using DateAt(1841,0,0) you may be excluding/including some people by mistake.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: censuses - query with different values for an output column
Hi Mike L,
I've had a look but can't find where to download CensusMissingAges, could you tell me where to find it, please?
Many thanks
I've had a look but can't find where to download CensusMissingAges, could you tell me where to find it, please?
Many thanks
Re: censuses - query with different values for an output column
Mike Loney
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
Re: censuses - query with different values for an output column
I was just experimenting with the original query (https://fhug.org.uk/kb/download/ages-on-census-3/).tatewise wrote: ↑02 Nov 2022 16:49Interesting!
Why do you choose to use only explicit Birth Dates instead of Estimated, but do use Estimated Death Dates?
Have you considered the following more compact function instead of the nested TextIf(...) function:
CombineText( , %INDI.CENS[year=1841].AGE%, , " find " )
Also, by using DateAt(1841,0,0) you may be excluding/including some people by mistake.
i didn't design it per se, it just evolved. If it ain't broke, don't fix it.
It did what I wanted and didn't seem to miss anyone, so I left well alone
Now if only we could get colour into the reultset
Mike Loney
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: censuses - query with different values for an output column
This is an area where the Knowledge Base Downloads need improving because the title of the article often bears little resemblance to the name of the download file!
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: censuses - query with different values for an output column
Miketate,
I agree, I even had trouble finding it again
I resorted to my browser history to find where I got it from. I really couldn’t recall what search term I had used!
BTW is there somewhere that lists ALL queries available for download?
I agree, I even had trouble finding it again
I resorted to my browser history to find where I got it from. I really couldn’t recall what search term I had used!
BTW is there somewhere that lists ALL queries available for download?
Mike Loney
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: censuses - query with different values for an output column
FHUG > Knowledge Base > Downloads/Plugins > Downloads > Queries > All.
However, that lists the article titles rather than the download filenames.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: censuses - query with different values for an output column
Ok, but why are they listed with plugins? That just confuses people (i.e me
), who don’t associate queries with plugins!
Makes more sense to list them as FHUG > Knowledge Base > Downloads/Queries
Makes more sense to list them as FHUG > Knowledge Base > Downloads/Queries
Mike Loney
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: censuses - query with different values for an output column
But Queries ARE Downloads, Mike. We can't enumerate every type of download on the menu. It would get a bit long 
Pluginds ar elisted separately as the link takes you away from the KB to the Plugin Store.
Pluginds ar elisted separately as the link takes you away from the KB to the Plugin Store.
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history
Re: censuses - query with different values for an output column
I know what you mean, but why is it headed Downloads/Plugins?ColeValleyGirl wrote: ↑02 Nov 2022 18:55But Queries ARE Downloads, Mike. We can't enumerate every type of download on the menu. It would get a bit long
Pluginds ar elisted separately as the link takes you away from the KB to the Plugin Store.
Why not just Downloads? This would cover Queries and Plugins etc. It is the /Plugins in the title that I find confusing
Mike Loney
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: censuses - query with different values for an output column
Mike
That menu item has a link to the plugin store under it, so I'm not sure why you find it confusing that it says so. Or are you saying you think of them as the same thing, technically we cant do anything other than link offsite for them - there's no way to list them all under the downloads page.
(It also has link to code snippets for plugin authors but those are a minority interest so arent shown in the 'headline'.)
That menu item has a link to the plugin store under it, so I'm not sure why you find it confusing that it says so. Or are you saying you think of them as the same thing, technically we cant do anything other than link offsite for them - there's no way to list them all under the downloads page.
(It also has link to code snippets for plugin authors but those are a minority interest so arent shown in the 'headline'.)
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history
- BillH
- Megastar
- Posts: 2184
- Joined: 31 May 2010 03:40
- Family Historian: V7
- Location: Washington State, USA
Re: censuses - query with different values for an output column
Would it be less confusing if it said "Downloads & Plugins" rather than "Downloads/Plugins/?
Just a thought... I have no problems with the way it is.
Bill
Just a thought... I have no problems with the way it is.
Bill
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: censuses - query with different values for an output column
I suspect Mike's point is that Plugins are Downloads just as much as Queries, Diagram Types, Fact Sets, etc.
So why highlight Plugins in the Menu name but not Queries, etc.
Suggestion:
In the Menu just have a Downloads option that opens a Downloads page similar to the current page.
In addition to the existing 10 sub-headings, add a sub-heading for Plugins and another for Plugin Snippets.
Those can then refer to the Plugin Store and Snippets respectively.
So why highlight Plugins in the Menu name but not Queries, etc.
Suggestion:
In the Menu just have a Downloads option that opens a Downloads page similar to the current page.
In addition to the existing 10 sub-headings, add a sub-heading for Plugins and another for Plugin Snippets.
Those can then refer to the Plugin Store and Snippets respectively.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: censuses - query with different values for an output column
Mike, that would be a huge redesign that made the underlying architecture much more complex.
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history
Re: censuses - query with different values for an output column
Helen,
All I’m suggesting is that top level says Downloads, rather than Downloads/Plugins! It is the word Plugins in the title that puts me off. The rest of the menu structure is fine, and doesn’t need changing.
All I’m suggesting is that top level says Downloads, rather than Downloads/Plugins! It is the word Plugins in the title that puts me off. The rest of the menu structure is fine, and doesn’t need changing.
Mike Loney
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: censuses - query with different values for an output column
Then how would the people who dont think plugins and downloads are the same thing know where to look for plugins?
And what menu structure would you have beneath Downloads? The same as now (wouldnt that be weird?). Or would you use a different word for downloads (confusing)
And what menu structure would you have beneath Downloads? The same as now (wouldnt that be weird?). Or would you use a different word for downloads (confusing)
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history
Re: censuses - query with different values for an output column
Helen,
If people don’t think downloads and plugins are the same, how do they expect to get plugins without downloading them? Carrier pigeon?
If people don’t think downloads and plugins are the same, how do they expect to get plugins without downloading them? Carrier pigeon?
Mike Loney
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com
Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com