Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello,
Does anybody know why this script creates severals tables Contenu, Contenu-1, Contenu-2 in place of concatenate them in only 1 ?
Contenu_qvd:
LOAD fichierqvd
FROM
(ooxml, embedded labels, table is Feuil1);
For i=0 to NoOfRows('Contenu_qvd')-1
LET vQVD = Peek('fichierqvd','$(i)','Contenu_qvd');
CONTENU:
LOAD *,
filename() as Nomqvd,
datepar&'|'&editionsec&'|'&folio as %key
FROM ..\..\SourceDocuments\CONTENU\QVD_nrga\$(vQVD) (qvd);
next i;
I think that this script would work fine with .csv files isn't it ?
Thank you very much in advance .
Arnault
Contenu_qvd:
LOAD fichierqvd
FROM
(ooxml, embedded labels, table is Feuil1);
CONTENU:
LOAD * inline [
temp ];
For i=0 to NoOfRows('Contenu_qvd')-1
LET vQVD = Peek('fichierqvd','$(i)','Contenu_qvd');
concatenate(CONTENU)
LOAD *,
filename() as Nomqvd,
datepar&'|'&editionsec&'|'&folio as %key
FROM ..\..\SourceDocuments\CONTENU\QVD_nrga\$(vQVD) (qvd);
next i;
drop field temp ;
Hi there,
Try only naming the top table in your script.
Then use the function Concatenate()
e.g.
Contenu_qvd:
LOAD fichierqvd
FROM
(ooxml, embedded labels, table is Feuil1);
For i=0 to NoOfRows('Contenu_qvd')-1
LET vQVD = Peek('fichierqvd','$(i)','Contenu_qvd');
Concatenate(Contenu_qvd)
LOAD *,
filename() as Nomqvd,
datepar&'|'&editionsec&'|'&folio as %key
FROM ..\..\SourceDocuments\CONTENU\QVD_nrga\$(vQVD) (qvd);
next i;
thank you matthew,
Contenu_qvd is table with the qvds to load.
i want contenate them in a another table CONTENU .
A.
So you want to load in each QVD and concatenate them,
then
Add the CONTENU table to the end of it?
CONTENU does not pre-exist
CONTENU is the destination table of the qvd loaded in the loop
Contenu_qvd:
LOAD fichierqvd
FROM
(ooxml, embedded labels, table is Feuil1);
CONTENU:
LOAD * inline [
temp ];
For i=0 to NoOfRows('Contenu_qvd')-1
LET vQVD = Peek('fichierqvd','$(i)','Contenu_qvd');
concatenate(CONTENU)
LOAD *,
filename() as Nomqvd,
datepar&'|'&editionsec&'|'&folio as %key
FROM ..\..\SourceDocuments\CONTENU\QVD_nrga\$(vQVD) (qvd);
next i;
drop field temp ;
it works fine, thank you very much.
is this issue specific with qvd files.
because it works with xlsx files without initialisation of CONTENU table
see below
contenu_xls:
LOAD * INLINE [
name
tb1.xlsx
tb2.xlsx
];
For i=0 to NoOfRows('contenu_xls')-1
LET vFIC = Peek('name','$(i)','contenu_xls');
CONTENU:
LOAD *
FROM
(ooxml, embedded labels, table is Feuil1);
next i;
No it is not specific to file type, but if structure of your all excel file is same then it works without concatenate, but if any of the file differs in structure it fails.(for eg. 1 file having 3 fields and other file having 4 fields) all field name should be identical
Please close the thread by marking the correct answer
Glad to see you got the correct answer below!