Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
OmarBenSalem

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

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:

table:

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') ;

tableFinale:

Load

  "Commodity Name",

  "Commodity Code",

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

Next



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

0 Replies