Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to import a metadata file for invoice creation.
There are two versions, one with only one invoice, and another with n invoices.
They both have in common that I have to transform them, and rotate them right to get the Fieldname / Data.
Layout Example without transform:
0HCDLNRE DE
0HCTTXDE Deutschland
0HCTTXRE Deutschland
0HDACUA1 asdf
0HDACUA3 gerg
0HDACUA4 Fsdf
Importing the files with only one invoice is quiet easy, but I am not able to import the files with many invoices.
Each new invoice begins with the following header:
BEGINOIS1990H
*TIME 20170818082841
*LANGUAGE DE
*ZZCONO 0
*ZZDIVI
*ZZFACI 100
*ZZWHLO 100
*LAYOUT A4
I would have to tell Qlikview to create a line feed before the next instance of "BEGINOIS1990H" begins I guess.
Does anyone have an idea on how to solve this task?
For testing I attached an example with a header and 2 invoiceheaders
Thanks in advance
May be You can do something like below
RawData:
LOAD @1,
@2
FROM
[\\lnn63f1\u_t1487402003\sasidp\My Documents\Qlikview\TST Invoice.txt]
(txt, codepage is 1252, no labels, delimiter is '\t', msq);
// exit script;
set vtable='T1';
For i=0 to NoOfRows('RawData')
LET vField1= FieldValue('@1',$(i));
If '$(vField1)'='BEGINInvoice' THEN
For j=1 to 5
LET vField$(j)= FieldValue('@1',$(i)+$(j));
LET vData$(j)= FieldValue('@2',$(i)+$(j));
Next j
$(vtable):
LOAD
'$(vData1)' AS '$(vField1)',
'$(vData2)' AS '$(vField2)',
'$(vData3)' AS '$(vField3)',
'$(vData4)' AS '$(vField4)',
'$(vData5)' AS '$(vField5)'
AutoGenerate 1;
END IF;
Next i;
Drop Table RawData;
Works perfectly fine.
And with the restricted selection its performing well.
Thanks a lot!
Glad it helped.
Please mark a reply correct, that actually answered your question:
Qlik Community Tip: Marking Replies as Correct or Helpful
thanks
regards
Marco