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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
mustafaelryah
Creator
Creator

How to load from multiple text files

Dear All,

I need to load data from many files to one table,

first file name is Transactions All.txt

2nd name is       Transactions Methaq.txt

when I load it as4

load....from 

(txt, codepage is 1256, embedded labels, delimiter is '\t', msq);

its show me error, how can I solve that plz.

16 Replies
mustafaelryah
Creator
Creator
Author

Hi dear this seems is right, let me adjust it to my code and I will get back to you soon, thanks a lot

engishfaque
Specialist III
Specialist III

Dear mm,

You can load all the text file data using listed below code,

Load...from 

(txt, codepage is 1256, embedded labels, delimiter is '\t', msq);

Kind regards,

Ishfaque Ahmed

mustafaelryah
Creator
Creator
Author

Thanks dear for the helpful answer, but when I applied it on my code the header showing me these red lines:

how can I solve this

With Regards.

mustafaelryah
Creator
Creator
Author

Kindly find the below error when I applied this solution:

mustafaelryah
Creator
Creator
Author

I tried this solution but it gives me error on the reloading

Colin-Albert
Partner - Champion
Partner - Champion

You cannot combine the preceeding load that is doing the applymap inside a loop.

Load the data in the loop into a temp table first, then use a resident load to generate the final table with the applymap and other commands.

Your example was posted as an image so the complete script is not available to view or copy. It is better to post scripts as text.

Try something like this

Set vConcatenate = ;
For Each vFile in FileList('D:\QlikView\Transaction*.TXT')

     tmpTable:
     $(vConcatenate)
     Load *,
     FileName() as FileName
     From  "$(vFile)"
     (
txt, codepage is 1256, embedded labels, delimiter is '\t', msq);
     Set vConcatenate = Concatenate ;
Next vFile ;


FinalTable:

load

    text(company) & '-' & Text(BranchObject) as #Company ,

     // add more commands here

     *

resident tmpTable ;


drop table tmpTable ;


mustafaelryah
Creator
Creator
Author

Finally it works, Thanks a lot Colin