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

How to make the table file name as TABLE1 ?

Hi All,

Below Script work fine , it will generate 2 Table name depend on the file name i load  :-

For Each i in '$(vFile2010)','$(vFile2011)','$(vFile2012)','$(vFile2013)','$(vFile2014)'
LOAD
'$(i)' as SOURCE_,
Date( Date#([Posting Date], 'MM/DD/YYYY'), 'DD/MM/YYYY') as [date],
ApplyMap('MAP_ISDN_REV',[GL Code],'REVENUE') as [rEVENUE],
[Transaction Type]
FROM
$(vRAWPath)$(i)
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
NEXT i;

For Each i in '$(vFile2015)','$(vFile2016)'
LOAD
'$(i)' as SOURCE_,
date#(@58:77T,'DD/MM/YYYY') as date,
FROM
$(vRAWPath)$(i)
(ansi, fix, no labels, header is 0, record is line);
NEXT i;

May i know how can i assign the table name to be alway equal to TABLE 1 and TABLE 2 not depend the file name i load ?

Paul

 

Below is my Data model :-

file name.png

 

1 Solution

Accepted Solutions
Lisa_P
Employee
Employee

Just insert table name in script:

For Each i in '$(vFile2010)','$(vFile2011)','$(vFile2012)','$(vFile2013)','$(vFile2014)'

[Table 1]:
LOAD
'$(i)' as SOURCE_,
Date( Date#([Posting Date], 'MM/DD/YYYY'), 'DD/MM/YYYY') as [date],
ApplyMap('MAP_ISDN_REV',[GL Code],'REVENUE') as [rEVENUE],
[Transaction Type]
FROM
$(vRAWPath)$(i)
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
NEXT i;

For Each i in '$(vFile2015)','$(vFile2016)'

[Table 2]:
LOAD
'$(i)' as SOURCE_,
date#(@58:77T,'DD/MM/YYYY') as date,
FROM
$(vRAWPath)$(i)
(ansi, fix, no labels, header is 0, record is line);
NEXT i;

View solution in original post

1 Reply
Lisa_P
Employee
Employee

Just insert table name in script:

For Each i in '$(vFile2010)','$(vFile2011)','$(vFile2012)','$(vFile2013)','$(vFile2014)'

[Table 1]:
LOAD
'$(i)' as SOURCE_,
Date( Date#([Posting Date], 'MM/DD/YYYY'), 'DD/MM/YYYY') as [date],
ApplyMap('MAP_ISDN_REV',[GL Code],'REVENUE') as [rEVENUE],
[Transaction Type]
FROM
$(vRAWPath)$(i)
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
NEXT i;

For Each i in '$(vFile2015)','$(vFile2016)'

[Table 2]:
LOAD
'$(i)' as SOURCE_,
date#(@58:77T,'DD/MM/YYYY') as date,
FROM
$(vRAWPath)$(i)
(ansi, fix, no labels, header is 0, record is line);
NEXT i;