* Named List query
-
nconway567
- Gold
- Posts: 11
- Joined: 22 Jun 2022 20:01
- Family Historian: V7
Named List query
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
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
- tatewise
- Megastar
- Posts: 27082
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Named List query
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.
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
-
nconway567
- Gold
- Posts: 11
- Joined: 22 Jun 2022 20:01
- Family Historian: V7
Re: Named List query
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...
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...
- tatewise
- Megastar
- Posts: 27082
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Named List query
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.
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
-
nconway567
- Gold
- Posts: 11
- Joined: 22 Jun 2022 20:01
- Family Historian: V7
Re: Named List query
Sorry, I totally misunderstood. Ok, I added the column expression.
The Row expression is giving me trouble. You can see by the pink arrow there's not operators available. Never seen that happen before.
I guess I'm still doing something wrong
The Row expression is giving me trouble. You can see by the pink arrow there's not operators available. Never seen that happen before.
I guess I'm still doing something wrong
-
nconway567
- Gold
- Posts: 11
- Joined: 22 Jun 2022 20:01
- Family Historian: V7
Re: Named List query
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.
- LornaCraig
- Megastar
- Posts: 2996
- Joined: 11 Jan 2005 17:36
- Family Historian: V7
- Location: Oxfordshire, UK
Re: Named List query
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 :
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:
You will need a column for every List the Individual might be in, so keep adding more columns:
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:
You will need a column for every List the Individual might be in, so keep adding more columns:
Lorna
-
nconway567
- Gold
- Posts: 11
- Joined: 22 Jun 2022 20:01
- Family Historian: V7
Re: Named List query
It works!
Thank you Lorna and Tatewise for the assistance!
Nconway
Thank you Lorna and Tatewise for the assistance!
Nconway