Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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 ;
Does the two files follow the same structure and include the same fieldnames?
For difference due to fieldnames or structure, try a for loop:
Sure, Same in every thing
There is no 's' in the file names, could that be the issue?
load....from
It may be better to create a loop to do the reload rather than using the wildcard *.
If you use a loop, you can add a trace command to list which file is currently being processed and this may help identify the error, whereas the wildcard load does not identify which file is being processed.
It may be that one of the files differs from the others - using a loop would identify this.
The wildcard in the file name usually works - but not always. Then it is better to use a For - Next loop:
Set vConcatenate = ;
For Each vFile in FileList('D:\QlikView\Transaction*.TXT')
$(vConcatenate)
Load *,
FileName() as FileName
From "$(vFile)"
(txt, codepage is 1256, embedded labels, delimiter is '\t', msq);
Set vConcatenate = Concatenate ;
Next vFile
HIC
Hi,
Showing error means!
what is the error?
-Hirish
Sorry, the files contains s
Transactions All,
Transactions Methaq
and still I have the error
What is the error you are getting? Can you share the logfile?