Excel header rows

anto
Kilo Expert

Hi All,

We are using data source to do the transform of datas from import table to target table, The data source is triggered by   scheduled data import.

We specified the header row is 1 in data source so whenever we are updating the excel, it will take the first row of the excel file as header.

Now the challenge is we need to prevent/restrict the next row after the header to be processed.

I have tried to give the Header row as 2 and its not taking the both first and second rows, its taking the second row as the header.

we need to stop processing the record which placed in second row in the excel.

Is there any way to achieve this

Screen Shot 2016-05-18 at 11.39.06 AM.png

Thanks in advance

1 ACCEPTED SOLUTION

paramveer
Mega Guru

Hi Antony,



Go to your transform map, Checked the run script and write below code in Transform map run script :



if(source.sys_import_row==0 || source.sys_import_row==NULL) {


  ignore = true;


  }



As after header it will be the first row with index 0, so it will ignore the first row.


View solution in original post

4 REPLIES 4

paramveer
Mega Guru

Hi Antony,



Go to your transform map, Checked the run script and write below code in Transform map run script :



if(source.sys_import_row==0 || source.sys_import_row==NULL) {


  ignore = true;


  }



As after header it will be the first row with index 0, so it will ignore the first row.


Thanks Paramveer.



Its working .. The script "sys_import_row==0" checks the index of the row. Amazing


Is it possible to count how much rows filled in the Excel by using the "sys_import_row", because we need to allow only 1000 records(header, and row after header are excluded) to process.


yes It's also possible, you can write code like ;



if(source.sys_import_row >= 999) {


  ignore = true;


  }



Please mark correct/helpful if you find my reply worthy.



Thanks,


Param


Thanks once again paramveer .



Can i count the number of rows filled with data in Excel so that i can dynamically pass the value for validations ??