Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 :-
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;
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;