Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good afternoon dear
I am trying to work with a text file but when I loading the file loses its integrity
LOAD
*
FROM [lib://Datos Públicos/Edinxon Mora\XXX_SAP_1_2014_3.2017_2.txt]
(txt, utf8, embedded labels, delimiter is '|', header is 5 lines, no eof);
How should I charge?
Perhaps your text file is not an UTF8 encoded file. Perhaps you need to specify a codepage instead. Try someting like this:
LOAD
*
FROM [lib://Datos Públicos/Edinxon Mora\XXX_SAP_1_2014_3.2017_2.txt]
(txt, codepage is 1252, embedded labels, delimiter is '|', header is 5 lines, no eof);
Can you upload a sample of the text file. Just a couple of lines and a header?
Of course, I attach a file as an example in the first publication of the query
regards
This code works for me. I've listed field names explicit to avoid empty column name (first field) and I added condition on year to be numeric (SAP is repeating header):
LOAD
LibrMay,
Asignación,
Acreedor,
"Nº doc.",
Ce.coste,
Referencia,
Cl,
"Fecha doc.",
Div.,
ImpteML,
ML,
Fe.contab.,
"Importe en ML2",
ML2,
"Fecha pago",
Compens.,
Doc.comp.,
Texto,
Año,
Usuario,
Soc.,
ClMo,
Demora
FROM [lib://q/txt ejmp.TXT]
(txt, codepage is 1252, embedded labels, delimiter is '|', no quotes, header is 5 lines, no eof)
WHERE IsNum(Año);
Hi Tomasz,
I did what you recommended, but the data did not summarize the proper amount apparently because the table cut some items wrongly
:
The sum of the Amount field in ML2 is 12,173,111.37 and in the Qlik is 12,178,881.
additionally I replaced the file as an example in the first publication of the query
You have comma as a thousand delimeter in SAP - maybe that is messing the numbers. Could you try to change it?
It's in menu: System/User profile/Own data/Defaults.
Tomasz