2 Replies Latest reply: Oct 23, 2013 6:40 AM by Gysbert Wassenaar RSS

    Scripting problem - plz help!

    Friedrich Hofmann

      Hi,

       

      I have a very strange problem in my script: A few records disappear for no apparent reason - even worse:

      => In one and the same LOAD statement, I load a field twice - once, all is ok - the other time, certain values are missing...

       

      I will for now just post the piece of the script where I have a problem as I'm absolutely sure the problem is in that part.

       

       

      // Here I load a filtering table to load only those values of PERSEH that I need for my chart
      Filter_emps:
      LOAD
          
      PERSEH as Vorg_einh,
          
      PERSEH as Vorg
      FROM
      [\\rgb1sfs201\Regensburg\Common\03-HR\adicom_Vorgängereinheiten.xls]
      (
      biff, embedded labels, table is [Gesamtmapping$]);

      MA_Grunddaten_#3_pre:
      LOAD
      //    Recno() as Line,
          Pers_Nr4 as Pers_Nr5,
         
      Kennz as Kennz_2,
         
      Eintritt as Eintritt_2,
         
      Month(Eintritt) as Eintrittsmonat_2,
         
      year(Eintritt) as Eintrittsjahr_2,
         
      Austritt as Austritt_2,
         
      Month(Austritt) as Austrittsmonat_2,
         
      year(Austritt) as Austrittsjahr_2,
         
      IF(Austritt <= TODAY(), Austritt, TODAY()) as Enddatum_2,
      //    Kostenstelle,
          Vorgängereinheit as Vorg_einh,
         
      Vorgängereinheit as Pers_einh
      RESIDENT MA_Grunddaten
      //WHERE (Kennz = '7' OR Kennz = '8')
      WHERE    EXISTS(Vorg, Vorgängereinheit)

       

      As you see, this is a RESIDENT LOAD, I have my base_load from the database in an earlier part of the script. The relevant point is this field "Vorgängereinheit": I load this twice because once it is being used as a key to link to "Filter_emps" and the other one is used for further processing.

      The strange thing is this: In the field "Vorg_einh" (the key_field), certain values are included - all values are there actually. When, in the table "Filter_emps", I select those values in the field "Vorg", the field "Vorg_einh" follows that selection, the values are there.

      <=> The field "Pers_einh" (the name is used for the first time in this table) does not follow the selection, the values are NOT there.

      Can anybody help me see through this?

       

      Thanks a lot!

      Best regards,

       

      DataNibbler