Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi
i want to Import a txt file, but the Header breaks to the 2nd line. Is this is a qlikview Problem or the txt file has somehow a break line? how can i solve this?
thanks
Can you attach that sample file if possible. Looks like a problem with the file.
HI
the file is too big to open it in Notepad++ and i cannot attach the file. It was a semicolon delimited text file, and the break is exactly at the "WHITE" Level Name, as shown in the wizard
it really seems that is a Problem with the file
then don't use embedded labels but name your fields like
load
@1 as fieldname
...
from yourcsvfile.csv
...
;
Maybe you can choose Header Size > Line as 2 then, it will pick the second row as header. Then you will have to go and rename the fields individually.
Like based on your example,
Load
White as Field1,
Contact_optin_freepack as Field2,
............
good Option i try this
thanks
Hi,
another solution to rename the fields with the concatenated values of the top 2 rows:
LET vHeaderRows = 2;
tabColsTemp:
CrossTable (ColNam, ColNamNew)
LOAD RecNo() as RecNo,
*
FROM
(txt, codepage is 1252, no labels, delimiter is ',', msq)
Where RecNo() <= $(vHeaderRows);
tabCols:
Mapping LOAD
ColNam,
Concat(ColNamNew, ' ', RecNo) as ColNamNew
Resident tabColsTemp
Group By ColNam;
DROP Table tabColsTemp;
table1:
LOAD *
FROM
(txt, codepage is 1252, no labels, delimiter is ',', msq, header is $(vHeaderRows) lines);
RENAME Fields using tabCols;
use the variable vHeaderRows to define the number of rows that hold the field names.
input:
hope this helps
regards
Marco