Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

edinxon_mora
New Contributor

How can I charge a TXT file

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?

7 Replies

Re: How can I charge a TXT file

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);


talk is cheap, supply exceeds demand
edinxon_mora
New Contributor

Re: How can I  charge a TXT file

Thank you very much for your answer, Gysbert

I tried the code but I did not succeed.

Previously I forget to mention that the text file to get the SAP file without conversion

Re: How can I  charge a TXT file

Can you upload a sample of the text file. Just a couple of lines and a header?


talk is cheap, supply exceeds demand
edinxon_mora
New Contributor

Re: How can I charge a TXT file

Of course, I attach a file as an example in the first publication of the query

regards

tomasz_tru
Valued Contributor

Re: How can I charge a TXT file

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);

edinxon_mora
New Contributor

Re: How can I charge a TXT file

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

Total_ML2.png

tomasz_tru
Valued Contributor

Re: How can I charge a TXT file

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

Community Browser