7 Replies Latest reply: Feb 16, 2015 10:13 AM by ioannis giakoumakis RSS

    Difficult issue in a loop

    Friedrich Hofmann


      Hi,

       

      I have the following issue:

      - In my underlying Excel_file, the last column that is currently populated is AG (or 33) (that is like a counter, the total of operating hrs
        as it was in January - the data of February will be available in the first days of March)

        <=> Then, one column will be added next to AG (so the new one will be 34)

        ... and so on every month from now

         => so the last column to be added in the first days of December will be 43 (the December data will be in next year's list)

       

      => I have a loop running from a counter of 34 to 43, parsing the columns for a keyword to identify whether or not it is a data_field and
          - if it is, it is loaded with an alias_name following a specified naming_format

           - if it is not (example), it is loaded with the value 'dummy_35' and the alias_name 'dummy_35'.

      => All of those fields are included in the LOAD

       

      - Then I have another loop running from a counter of 10 to 20 (on the table just loaded because what used to be column 34 is now column 10, but still called like 'dummy_34')

      => If one of those fields starts with 'dummy', a DROP FIELD statement is constructed in a variable using the Fieldname() function on that table (always adding 24 to the counter to get the correct field_name)

       

      The strange thing is: That loop runs without issues up to the counter of 15 (or 39) - the last fields, although the syntax is exactly the same (those fields are all created in the first loop) are ignored: The IF_function is just skipped as I can see in the Debugger and the commands within that IF_THEN_loop are not executed.

       

      Can anyone tell me what might be the difference that I cannot see there?

      Thanks a lot!

      Best regards,

       

      DataNibbler