1 Reply Latest reply: Nov 5, 2014 3:34 AM by Friedrich Hofmann RSS

    Field not present in new lists?

    Friedrich Hofmann


      Hi,

       

      I am loading a series of Excel_lists for a chart. They all have the same "filename_format", so I have a variable and load them all in a loop.

      The issue is this:

      - These are lists of distinct events, each of which has a monetary factor - there are two columns for that

      <=> The new lists (for the current month, sometimes even for the one before) have not yet been assigned monetary values - that must
              be done manually because prices can shift all the time - so those two fields just don't exist in those newer lists.

       

      Of course, I can ask the people populating those lists to just include those columns in the newer lists as well - then I can just query whether there is anything in those fields and if not I just populate it with 0. In fact, that's what I have done.

      Still, I'd like to know, would it be possible to include those fields in the LOAD - but conditional, so that the fields are only loaded if they exist?

       

      Thanks a lot!

      Best regards,

       

      DataNibbler

        • Re: Field not present in new lists?
          Friedrich Hofmann

          Hmm ... I have a possibility, but it's not the most elegant, so the other way would probably be preferable.

          It is possible using the FieldName() function, but for that you have to first load the entire table (with an asterisk), then check the fieldname of the column where that monetary_value should be and if the fieldname is right,

          then load the whole thing again including those fields

          <=> otherwise load it all, using a fixed value for the missing fields to avoid structural assymetry lateron.

          That would make the whole loop bigger. It is possible, though.