* Named List query

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
avatar
nconway567
Gold
Posts: 11
Joined: 22 Jun 2022 20:01
Family Historian: V7

Named List query

Post by nconway567 » 01 Sep 2022 01:07

Hello
I was wondering if there is a way to write a query to display the membership of named list for a single individual? Kind of the opposite of the built in "Named List Members" query, i.e. John Doe, Named List A, Named List B, etc...

thanks in advance
Nconway

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Named List query

Post by tatewise » 01 Sep 2022 19:21

If you inspect the Named List Members query you'll see it uses the =IsInList(...) function on the Rows tab.

The inverse query you ask for would need to be coded with the names of your current Named Lists.
For example, one Column could use the Expression =TextIf( IsInList(,"List A"), "List A" )
Then the next Column would use the Expression =TextIf( IsInList(,"List B"), "List B" )
Then repeat each Column with each Named List name.

If you want to eliminate Individuals who are not in any list then the Rows tab would need:
Add if IsInList(,"List A") is true
Add if IsInList(,"List B") is true
and so on for every Named List.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
nconway567
Gold
Posts: 11
Joined: 22 Jun 2022 20:01
Family Historian: V7

Re: Named List query

Post by nconway567 » 01 Sep 2022 21:23

Thanks tatewise - this is a lot better than using the Parameter and having to run it over and over. Should I use And If for =TextIf(IsInList(,"List A"),"List A",) as well?

I've tested it a bit by adding my record to a few groups, and using And IF. The result set returns my name for named lists I'm in and NOT in.

Is this correct? See image...
query.jpg
query.jpg (123.27 KiB) Viewed 583 times

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Named List query

Post by tatewise » 01 Sep 2022 21:42

No, you seem to have gone in a very different direction from what I suggested.

Your first Filter unconditionally adds any Individual record that matches the Parameter, which explains the Result Set you are getting.

Your second Filter will never add any Individual.
=TextIf(IsInList(,"List E"),"List E",) can only be "List E" or "" so can never match "General Notes".

Assuming the Named List involved is "General Notes" then
Set a Column to the Expression =TextIf( IsInList(,"General Notes"), "General Notes" )
Set the Row Filter to Expression Add if IsInList(,"General Notes") is true

Then only the Individual record(s) in the "General Notes" Named List will appear in the Result Set.

To cater for all Named Lists, the above Column and Row Expressions must be repeated for each one.

The Column Expressions list the Named Lists after each Individual in the Result Set, which is what you requested.
The Row Filters exclude Individuals that don't appear in any Named List.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
nconway567
Gold
Posts: 11
Joined: 22 Jun 2022 20:01
Family Historian: V7

Re: Named List query

Post by nconway567 » 01 Sep 2022 22:07

Sorry, I totally misunderstood. Ok, I added the column expression.
Column.jpg
Column.jpg (142.28 KiB) Viewed 573 times


The Row expression is giving me trouble. You can see by the pink arrow there's not operators available. Never seen that happen before.

Row.jpg
Row.jpg (110.88 KiB) Viewed 573 times

I guess I'm still doing something wrong ;)

avatar
nconway567
Gold
Posts: 11
Joined: 22 Jun 2022 20:01
Family Historian: V7

Re: Named List query

Post by nconway567 » 01 Sep 2022 22:20

Never mind the last reply. I see where I went wrong. Needed the = in the expression. However, I'm getting over 26000 results. I wanted to narrow the scope down to one person and display just the groups they are a part of.

User avatar
LornaCraig
Megastar
Posts: 2996
Joined: 11 Jan 2005 17:36
Family Historian: V7
Location: Oxfordshire, UK

Re: Named List query

Post by LornaCraig » 02 Sep 2022 00:07

To narrow it down to one individual use Row filter like this, where the Parameter lets you select the individaul when you run the query :
Row filter.JPG
Row filter.JPG (28.96 KiB) Viewed 559 times


That's the only Row filter you need. The Expression Mike gave you was a column expression, not a Row Expression.
You could either use Mike's expression and leave the column headings blank, or use the names of the lists as column headings and simply put a "Y" in the column if they are in the list. In the latter case the setting for one column will be like this:

Column.JPG
Column.JPG (19.05 KiB) Viewed 559 times


You will need a column for every List the Individual might be in, so keep adding more columns:
Columns.JPG
Columns.JPG (19.47 KiB) Viewed 559 times
Lorna

avatar
nconway567
Gold
Posts: 11
Joined: 22 Jun 2022 20:01
Family Historian: V7

Re: Named List query

Post by nconway567 » 02 Sep 2022 00:21

It works!

Thank you Lorna and Tatewise for the assistance!

Nconway

Post Reply