Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I have a folder named SELECTIONS which includes files like the following:
Where the file format is: Save_DD_MM_YYYY_HH_MM_SS.csv
I use the load function to get all the files in my application using: from Save_*.csv.
The issue comes here:
*** The files older than the date 15/05/2014 (DD/MM/YYYY) bring up 3 columns that I should load:
*** The files greater or equal that the date 15/05/2014 (DD/MM/YYYY) bring up 6 columns that I should load:
My question is how to do this, because first of all I tried loading all the 6 fields for all the files (using: from Save_*.csv), but I get an error that I believe it is because of the files that only have 3 fields where doesn't exist the other 3 fields...
How could I do to load all the files and create a single table with all the data and the 6 fields?
Thank you!!!
not sure what error are you referring to but maybe do something like this:
//Create a blank table with the columns you need to avoid synthetic keys
[HOLD]:
load * inline
[ACCOUNT_ID,ZONE,SAVE_DATE,Q_OB,Q_IN,Q_CO
];
//force concatenation
Concatenate
//load the data
[DATA]:
LOAD *
FROM
(ooxml, embedded labels, table is Sheet1);
You can later drop columns that you don't need or do a resident load with the required columns.
not sure what error are you referring to but maybe do something like this:
//Create a blank table with the columns you need to avoid synthetic keys
[HOLD]:
load * inline
[ACCOUNT_ID,ZONE,SAVE_DATE,Q_OB,Q_IN,Q_CO
];
//force concatenation
Concatenate
//load the data
[DATA]:
LOAD *
FROM
(ooxml, embedded labels, table is Sheet1);
You can later drop columns that you don't need or do a resident load with the required columns.
Hi Micro,
Try this
Load *,
from Save_*;
It takes all fields from all files.
Hopes it will helpful.
Thanks,
Ashok.
HI Ashok,
Your solution will create two tables (plus synth key) but the op was asking for a single table.
Cheers,
Paul