Jump to content


Photo

Way to find out if Primary photo unchecked?

Media Tag Photo

  • Please log in to reply
5 replies to this topic

#1 RootsMagicLover

RootsMagicLover

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts

Posted 17 December 2017 - 12:27 PM

I am running Windows 10 with RM7, and find that there are some relatives that I have pictures for, but have not checked the Primary photo for this person box, but the Include in scrapbook for this person is checked, under Media Tag.

Can I run a query on the absence of Primary, but Include to determine how many relatives have this issue, which shows up with no photo on my iphone app and also when I create a shareable CD?

 

thank you for any helpful comments.

 



#2 TomH

TomH

    Advanced Member

  • Members
  • PipPipPip
  • 6435 posts

Posted 17 December 2017 - 09:41 PM

I'm unaware of any way to do what you want in RM short of inspecting each person. You could use a SQLite query outside RM to find all such cases. This script does something relevant: http://sqlitetoolsfo...oto for Persons

Tom user of RM7630 FTM2017 Ancestry.ca FamilySearch.org FindMyPast.com
SQLite_Tools_For_Roots_Magic_in_PR_Celti wiki, exploiting the database in special ways >>> RMtrix-tiny.png app, a bundle of RootsMagic utilities.


#3 RootsMagicLover

RootsMagicLover

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts

Posted 26 December 2017 - 10:30 PM

This may work for me, however, I made a copy, ran the *.sql, and SQLiteSpy told me that there were 2 changes. 

This may be valid, but before I use it on my main database, I want to make sure that I can run a .sql on it to just show the

people who are missing the Primary selection, yet have the scrapbook checked.

 

This would give me the validity then to be able to use this on all three of my family databases, which include over 45,000 individuals.



#4 TomH

TomH

    Advanced Member

  • Members
  • PipPipPip
  • 6435 posts

Posted 26 December 2017 - 11:08 PM

Sure. The core of that script with slight modification will show the record numbers of those without a Primary photo. If you have people with media that is intentionally not marked for Scrapbook, then the script needs further revision to exclude them from consideration (see ****). 

       SELECT  OwnerID
       FROM    ( SELECT  *
               FROM     ( SELECT    ML.LinkID        -- tag number
                                 , ML.OwnerID        -- RIN for person, given the constraint below
                                 , ML.IsPrimary      -- 1 if tag box checked "Primary photo for this person" else 0
                        FROM       MediaLinkTable ML -- media tags table
                                   INNER JOIN MultiMediaTable MM
                        USING      (MediaID)        -- mediafiles table
                        WHERE      ML.OwnerType = 0 -- person
                        AND        MM.MediaType = 1 -- image type
                        AND        ML.Include1      -- =1 for include in Scrapbook****
                        ORDER BY   ML.OwnerID       -- sort by ownerid then
                                 , ML.IsPrimary     -- isprimary, putting any tag for the person set as primary to the bottom of the list
                        )
               GROUP BY OwnerID -- only the last LinkID in the list for the person comes out
               )
       WHERE   NOT IsPrimary -- only the last LinkID for a person with tags, none marked primary
 

Tom user of RM7630 FTM2017 Ancestry.ca FamilySearch.org FindMyPast.com
SQLite_Tools_For_Roots_Magic_in_PR_Celti wiki, exploiting the database in special ways >>> RMtrix-tiny.png app, a bundle of RootsMagic utilities.


#5 RootsMagicLover

RootsMagicLover

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts

Posted 27 December 2017 - 10:06 PM

Thank you so much for this script!  

It found 4 persons who demonstrated this issue, out of a 45,000 plus database!



#6 TomH

TomH

    Advanced Member

  • Members
  • PipPipPip
  • 6435 posts

Posted 28 December 2017 - 03:46 PM

Remarkable there were less than 0.01% with that condition. You must have been very consistent in selecting a primary photo whenever there was that option. Else the script is missing something...


Tom user of RM7630 FTM2017 Ancestry.ca FamilySearch.org FindMyPast.com
SQLite_Tools_For_Roots_Magic_in_PR_Celti wiki, exploiting the database in special ways >>> RMtrix-tiny.png app, a bundle of RootsMagic utilities.