1 Reply Latest reply on Oct 23, 2013 4:30 PM by philmodjunk

    Relationship Issues

    PeterBue

      Title

      Relationship Issues

      Post

           Hello All,

           To start with, I must say that I'm a beginner when it comes to using Filemaker pro, but I'll do my best to make this question as plain as possible.

           At the moment I'm working with a database that has a flat one-table database of content and related images. For each record there is 4 images, and for each image there is a set of textual data. I was asked to separate the images and their related data from the current table to another table (so they can analyze the image data separately from the content data). The issue with this is the images used to be in 4 separate fields in the old model, IMGA IMGB IMGC IMGD. I was asked to make the new fields generic for every instance of an image. Example below.

      OLD table for image fields

             
      •           Record number
      •      
      •           Image A
      •      
      •           Image A Source
      •      
      •           Image A Caption
      •      
      •           Image A Filename
      •      
      •           Category A
      •      
      •           Property A
      •      
      •           Talent A

            

      NEW table for images (All generic)

             
      •           Record number
      •      
      •           Image
      •      
      •           Position (A-D)
      •      
      •           Image Source
      •      
      •           Image Caption
      •      
      •           Image Filename
      •      
      •           Category
      •      
      •           Property Talent

           The problem that I’m having is that I need a one to many relationships between record number and position so that I can display the information the same way as the old database’s layout. I need a way of displaying this data correctly in the layout based on it’s position field.

           SELECT * FROM image WHERE Record_Number = “15” AND position = “A” ;

           (Example of what I mean in SQL terms.)

           I know this is a vague and possibly overly broad question, but I need a Filemaker “Pro”. Haha I’m clever

           Thanks

        • 1. Re: Relationship Issues
          philmodjunk

               Seems like you need two tables instead of one. One table for the record number and data not specific to a given image and a related table of Image and fields of data specific to that image.

               MainTable----<Images

               MainTable::RecordNumber = Images::RecordNumber

               From there, filtered one row portals to images placed on the Main table layout could show Image A, B, C, etc by using a portal filter expression to specify the value in Position. OR a single sorted portal that sorts the records by position could show image A in the first Row, Image B in the second row...