Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
beck_bakytbek
Master
Master

Data import from similar tables

Hi Folks,

i have a situation:

there is a way of successful proceeding of date import from one table: i mean, if i have a few tabs (for instance: excel) with similiar fields within one tables, so i can use this solution:

For Each Sheetname in 'Jan', 'Feb', 'Mrz'

load

Country,

Turnover,

Expenses

From: \\....(ooxml, embedded labels, table is $(Sheetname));

Next;

it does work great

My Question is:

i have 3 Tables with different names(Turnover2015.txt, Turnover2016.txt, Turnover2015.txt) but with similar fields within each table.

I know i can concatenate them in script-area, but i want to know, whether i can use above solution for this issue.

Can i use above solution to solve this issue? if yes, how can i implement it?

thanks a lot

beck

1 Solution

Accepted Solutions
v_petrenko
Partner - Contributor III
Partner - Contributor III

Hi Beck, it seems you quite can use previously mentioned solution. If automatic concatenation doesn't work due to differences in tables structure then you may use forced concatenation with Concatenate ({tablename}) prefix before load.

For example:

/* template table */

[Data]:

LOAD

     Null() as [tmp.field]

AutoGenerate (0)

;

FOR Each vFileName in 'Turnover2015.txt', 'Turnover2016.txt'

Concatenate ([Data])

LOAD

Country,

Turnover,

Expenses

From

     /* common file path and variable file name */

      [\\....\$(vFileName)]

     /* file parameters, load one with the wizard and paste them here */

     (txt, delimiter is ',')

;

NEXT

DROP Field

     [tmp.field]

;

Please mark this answer as helpful and you question as answered if it suites you.

View solution in original post

4 Replies
v_petrenko
Partner - Contributor III
Partner - Contributor III

Hi Beck, it seems you quite can use previously mentioned solution. If automatic concatenation doesn't work due to differences in tables structure then you may use forced concatenation with Concatenate ({tablename}) prefix before load.

For example:

/* template table */

[Data]:

LOAD

     Null() as [tmp.field]

AutoGenerate (0)

;

FOR Each vFileName in 'Turnover2015.txt', 'Turnover2016.txt'

Concatenate ([Data])

LOAD

Country,

Turnover,

Expenses

From

     /* common file path and variable file name */

      [\\....\$(vFileName)]

     /* file parameters, load one with the wizard and paste them here */

     (txt, delimiter is ',')

;

NEXT

DROP Field

     [tmp.field]

;

Please mark this answer as helpful and you question as answered if it suites you.

beck_bakytbek
Master
Master
Author

Hi Vasily

thanks a lot for your feedback,

i use this path:

FROM [lib://Desktop/auftragseingang.txt]

(txt, codepage is 1252, embedded labels, delimiter is ';', msq);

and my table are : auftragseingang1.txt, auftragseingang21.txt, auftragseingang45.txt

how can i implement it this path on the base of your solution?

thanks a lot

beck

beck_bakytbek
Master
Master
Author

Hi Vasily,

i implemented this way:

FROM [lib://Desktop/$(vFileName)]

(txt, codepage is 1252, embedded labels, delimiter is ';', msq);

NEXT

DROP Field

[tmp.field]

;

and it does work, please can you confirm, that this way of proceeding is ok.

thanks a lot (Spasibo bolshoe saranee)

beck

v_petrenko
Partner - Contributor III
Partner - Contributor III

Well, if the script runs without errors and you can see all your data than ot works. Your code looks correctly.

Pojaluysta ))