Hi,
I've got a query which lists the year of a date of a fact. I want to have a column saying if that year is a census year or not. Is there a way of doing an "in array/list" function, please, something like
=TextIf(InArray(%FACT.DATE.YEAR%, 1841, 1851, 1861, 1871, 1881, 1891, 1901, 1911, 1921, 1936),"Y","N")
rather than doing a multiple/nested OR function(s)?
Many thanks,
* Query: 'If data in a set/array/list' function [FH v7]
Query: 'If data in a set/array/list' function [FH v7]
Last edited by tatewise on 02 Jan 2023 10:35, edited 1 time in total.
Reason: Replace " with ' in subject.
Reason: Replace " with ' in subject.
- tatewise
- Megastar
- Posts: 27078
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Query: 'If data in a set/array/list' function [FH v7]
Yes, by using the new =FindText(...) function.
e.g.
=FindText( "1841 1851 1861 1871 1881 1891 1901 1911 1921 1939", %FACT.DATE:YEAR%, 1 )
will return the integer position where the Fact Year is found, or 0 if there is no match.
You could even go one step further and use complete dates.
e.g.
=FindText( "6 June 1841, 30 March 1851, ... etc, 29 September 1939", %FACT.DATE%, 1 )
That will find a match for the full date, or if only the month & year or just the year exists in the fact and matches.
So you will get a match for the dates 6 June 1841 and March 1851 and 1939 but not May 1851.
e.g.
=FindText( "1841 1851 1861 1871 1881 1891 1901 1911 1921 1939", %FACT.DATE:YEAR%, 1 )
will return the integer position where the Fact Year is found, or 0 if there is no match.
You could even go one step further and use complete dates.
e.g.
=FindText( "6 June 1841, 30 March 1851, ... etc, 29 September 1939", %FACT.DATE%, 1 )
That will find a match for the full date, or if only the month & year or just the year exists in the fact and matches.
So you will get a match for the dates 6 June 1841 and March 1851 and 1939 but not May 1851.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Query: 'If data in a set/array/list' function [FH v7]
Wonderful!
Many thanks
Many thanks