Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hi guys, Concatenation using loops

Hi guys,

i am using this script to concatenate files using loops, but with this loop there are many concatenations taking place and my data model doesn't look good...please help me how to avoid that using auto increment

//concate

FOR Each vfile in FileList('C:\Users\w_318460\Desktop\New folder\*.xlsx')

Concat:

LOAD

  * from [$(vfile)]

(ooxml, embedded labels, table is Sheet1);

Concatenate

LOAD

* from [$(vfile)]

(ooxml, embedded labels, table is Sheet1);

NEXT vfile

Thanks

Yogesh

18 Replies
Not applicable
Author

Stefan field names get change in every file...like one will have empno,deptno,sal and other file may contain empno,loc,Dept

Not applicable
Author

after executing ua script i can see table-1 and table-2 in table table viewer.. which i dont want ...i need only one

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

SET vConcatenate = ;

FOR Each vfile in FileList('C:\Users\w_318460\Desktop\New folder\*.xlsx')

     Concat:

     $(vConcatenate)

     LOAD

          *

     FROM

          [(vfile)] (ooxml, embedded labels, table is Sheet1)

          ;

     SET vConcatenate =  Concatenate;

    

NEXT


talk is cheap, supply exceeds demand
Not applicable
Author

Capture.PNG

Not applicable
Author

Its working fine...thank you so much gysbert and stefan for ua assistance

Not applicable
Author

i am not able to understand what you actually did ...can you tell me what you did and how it works?

MarcoWedel

Hi,

another method could be:

Concat:

LOAD 0 as TempField

AutoGenerate 0;

FOR Each vfile in FileList('C:\Users\w_318460\Desktop\New folder\*.xlsx')

  Concatenate

  LOAD * From [$(vfile)] (ooxml, embedded labels, table is Sheet1);

NEXT vfile

DROP Field TempField;

hope this helps

regards

Marco

Not applicable
Author

Its working fine. thank you Macro

swuehl
MVP
MVP

If your request is resolved, then please close this thread.

Qlik Community Tip: Marking Replies as Correct or Helpful