Ocean West Posted April 2, 2004 Posted April 2, 2004 I have a table where the data comes in flat... the data columns has all the data to create 3 additional upper level hierarchical structures. In the past I would just export a sub summarized set this data several times then import the data into the corresponding upper levels. I am trying to figure a way to import the data sub summarized. So that I can avoid the "temp" files that I would have to generate. This represents my tables. Data is imported raw into LevelD LevelA -< LevelB -< LevelC -< LevelD I have tried Looping scripts but it takes way too long the fastest way is importing the records. and the fastest way to get the set I want is by sub summary export. I am hoping FP 7 can leverage some more features that eludes me. Thanks FileMaker Version: Dev 7 Platform: Mac OS X Panther
Ocean West Posted April 3, 2004 Author Posted April 3, 2004 I can't believe it I figured it out... This is how I did it.... In my Level D table I added 2 fields... keyB [result text] a_ID & " - " & b_ID keyC [result text] a_ID & " - " & b_ID & " - " & c_ID Then I created 3 Value Lists. val_A Uses Values from "Level D" first field = "Record_ID" also display values from second field = "a_ID" Sort using Second field val_B Uses Values from "Level D" first field = "Record_ID" also display values from second field = "keyB" Sort using Second field val_C Uses Values from "Level D" first field = "Record_ID" also display values from second field = "keyC" Sort using Second field Then Created 1 script. "GetRelated" Set Field [LevelD::gLevelA; ValueListItems ( Get ( FileName ) ; "val_A" )] Set Field [LevelD::gLevelB; ValueListItems ( Get ( FileName ) ; "val_B" )] Set Field [LevelD::gLevelC; ValueListItems ( Get ( FileName ) ; "val_C" )] From here I created 3 self-relationships: gLevelA = Record_ID gLevelB = Record_ID gLevelC = Record_ID The next script will first goto the related records in turn after each time I found the related set I can then bring up my target table and perform an import only importing the files I need. Then go on to the next. The net result is that the one flat file that has Hierarchal data can be split up w/ out the need to create any sub-summarized exports or perform complex looping scripts. If I get a chance I will create a demo file...
Ocean West Posted April 4, 2004 Author Posted April 4, 2004 Here is my sample file that demonstrates the process. FileMaker Version: Dev 7 Platform: Mac OS X Panther Levels.fp7.zip
Recommended Posts