Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
CUSTOMERS ONLY: Now accepting customer applications for the 2023 Luminary Program: SUBMIT NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
doespirito
Creator
Creator

Loading multiple qvd files and contenate them

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

1 Solution

Accepted Solutions
Kushal_Chawda

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 ;

View solution in original post

9 Replies
mattquinnterex
Creator II
Creator II

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;

doespirito
Creator
Creator
Author

thank you matthew,

Contenu_qvd is table with the qvds to load.

i want contenate them in a another table CONTENU .

A.

mattquinnterex
Creator II
Creator II

So you want to load in each QVD and concatenate them,

then

Add the CONTENU table to the end of it?

doespirito
Creator
Creator
Author

CONTENU does not pre-exist

CONTENU is the destination table of the qvd loaded in the loop

Kushal_Chawda

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 ;

doespirito
Creator
Creator
Author

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;

Kushal_Chawda

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

Kushal_Chawda

Please close the thread by marking the correct answer

mattquinnterex
Creator II
Creator II

Glad to see you got the correct answer below!