Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
serj_shu kush141087 petter-s mdmukramali franky_h79 antoniotiman its.anandrjs
Hi,
I need to write a Load Script where:
1. Table A is extracted on every 1st day of month and remains till 3rd of that month.
2. On 4th day of the month, Table A is replaced by Table B and remains till the end of the month.
3. This will be an ongoing process.
4. Desired but not mandatory: An option where Table A is only replaced when Table B is available in the source folder.
Table A and Table B have same fields. Data source is Excel. The difference is in the values not the fields.
Any help would be highly appreciated.
Thanks
Nick
Maybe something like that in loadscript:
If num(day(Today()))<4 then
TableA:
Load * From FILE_A; ELSE
TableB:
Load * From FILE_A;
end if
hope this helps
Maybe something like that in loadscript:
If num(day(Today()))<4 then
TableA:
Load * From FILE_A; ELSE
TableB:
Load * From FILE_A;
end if
hope this helps
and if you want to check if file b exists try something like this:
LET vFile = 'C:\Users\Admin\Desktop\Test\TableB.xlsx';
LET vFileExists = if(FileSize('$(vFile)') > 0, -1, 0);
IF $(vFileExists) THEN
IF num(day(Today()))<4 THEN
TableA:
Load * FROM
(ooxml, embedded labels, table is Tabelle1);
ELSE
TableB:
Load * FROM
(ooxml, embedded labels, table is Tabelle1);
end if
ELSE
TableA:
Load * FROM
(ooxml, embedded labels, table is Tabelle1);
In a loading, script do this way make some date variables nad then
LET vToday = Date(Today());
LET vMonthStart = MonthStart(Today());
LET vMonthEnd = MonthEnd(Today());
LET v3days = Date(vMonthStart+2);
LET v4days = Date(vMonthStart+3);
if $(vToday) <= $(v3days) then
TableA:
LOAD * Inline [
ColumnA
a
b
c ];
END If
if $(vMonthEnd) >= $(v4days) then
TableB:
LOAD * Inline [
ColumnA
a
b
c ];
END if
Thanks Frank. This works well!!