0 Replies Latest reply: Oct 30, 2017 9:30 AM by omar bensalem RSS

    Load only some columns from excel (depends on their name)

    omar bensalem

      Hi guys , stalwar1


      How should I proceed to select certain fields from a source;


      Example, I have a source with overs 200 columns;


      I want to select the first 2 column and then select the columns that has a numeric name (which will be my years):


      this is how I proceeded:


      load * 

      FROM [lib://folder/Book1.xlsx]

      (ooxml, embedded labels, table is Sheet1);


      Let vTotalFields = NoOfFields('table');


      For i = 1 to vTotalFields

      Let vVar$(i) = FieldName($(i) ,'table') ;






        "Commodity Name",

        "Commodity Code",

      if(isnum( FieldName($(i),'table'))=-1 , FieldName($(i),'table'))  Resident table;


      But, this did not the trick.. if I rename it as year, I'll have my years; but I don't want that, I want to control the column name within the excel file and if it's a numeric, I load it , if it's not; I don't