Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Error: Garbage after statement

I can't find the error in:

LOAD

    Título,

    "Data de início" as DataI,

    "Data limite" as DataF,

    "Status Final" as Status,

    Gestor as Champion,

    "ID Status" as IDS

FROM [lib://BD (s-bria-qlikse01_ext-in)/GESTÃO DE METAS/Status Ações.xlsx]

(ooxml, embedded labels, table is [BD])

I get the message: Garbage after statement

Anyone knows how to fix it or what could be causing it?

Thank you in advance.

22 Replies
oknotsen
Master III
Master III

What was the line of code BEFORE this LOAD statement?

Note that this load statement is missing a semi-colon at the end (which also might explain your error).

May you live in interesting times!
Not applicable
Author

This is what came before the LOAD:

SET ThousandSep='.';

SET DecimalSep=',';

SET MoneyThousandSep='.';

SET MoneyDecimalSep=',';

SET MoneyFormat='R$ #.##0,00;-R$ #.##0,00';

SET TimeFormat='hh:mm:ss';

SET DateFormat='DD/MM/YYYY';

SET TimestampFormat='DD/MM/YYYY hh:mm:ss[.fff]';

SET MonthNames='jan;fev;mar;abr;mai;jun;jul;ago;set;out;nov;dez';

SET DayNames='seg;ter;qua;qui;sex;sáb;dom';

SET LongMonthNames='janeiro;fevereiro;março;abril;maio;junho;julho;agosto;setembro;outubro;novembro;dezembro';

SET LongDayNames='segunda-feira;terça-feira;quarta-feira;quinta-feira;sexta-feira;sábado;domingo';

SET FirstWeekDay=6;

SET BrokenWeeks=1;

SET ReferenceDay=0;

SET FirstMonthOfYear=1;

SET CollationLocale='pt-BR';

LOAD

    Aeroporto,

    Nível,

    "Função Superior",

    Função,

    Gestor as Champion,

    Month(Mês) as Mês,

    Ano,

    "Tipo de Meta",

    "Valor Alvo",

    "Valor Real",

    "Peso da Meta",

    "% Atingido",

    "Peso Final",

    MêsID,

    MetaID

FROM [lib://BD (s-bria-qlikse01_ext-in)/GESTÃO DE METAS/Base Gestão de Metas 2016.xlsx]

(ooxml, embedded labels, table is [BD Metas Consolidadas])

Do you mind showing me where the semicolon goes? I'm sorry, I just recently started to use Qlik.

Thank you for the help!

Not applicable
Author

Oh, ok, I just saw where the semicolons were missing and added them (after the FROM sentences).

Now I got a new error:

Ocorreram os seguintes erros:

Unknown Error

O erro ocorreu aqui:

LOAD Título, "Data de início" as DataI, "Data limite" as DataF, "Status Final" as Status, Gestor as Champion, "ID Status" as IDS FROM [lib://BD (s-bria-qlikse01_ext-in)/GESTÃO DE METAS/Status Ações.xlsx] (ooxml, embedded labels, table is Sheet0$)

isaaclin
Contributor III
Contributor III

I think it is something wrong before this statement. Could you post more code before this statement?

isaaclin
Contributor III
Contributor III

I don't think you should add semicolon after from statement. I think something wrong with your first statement, could you comment out this part below, and try load your data? see what message you get?

LOAD

    Título,

    "Data de início" as DataI,

    "Data limite" as DataF,

    "Status Final" as Status,

    Gestor as Champion,

    "ID Status" as IDS

FROM [lib://BD (s-bria-qlikse01_ext-in)/GESTÃO DE METAS/Status Ações.xlsx]

(ooxml, embedded labels, table is [BD])

Not applicable
Author

Sure, so this is my complete code:

SET ThousandSep='.';

SET DecimalSep=',';

SET MoneyThousandSep='.';

SET MoneyDecimalSep=',';

SET MoneyFormat='R$ #.##0,00;-R$ #.##0,00';

SET TimeFormat='hh:mm:ss';

SET DateFormat='DD/MM/YYYY';

SET TimestampFormat='DD/MM/YYYY hh:mm:ss[.fff]';

SET MonthNames='jan;fev;mar;abr;mai;jun;jul;ago;set;out;nov;dez';

SET DayNames='seg;ter;qua;qui;sex;sáb;dom';

SET LongMonthNames='janeiro;fevereiro;março;abril;maio;junho;julho;agosto;setembro;outubro;novembro;dezembro';

SET LongDayNames='segunda-feira;terça-feira;quarta-feira;quinta-feira;sexta-feira;sábado;domingo';

SET FirstWeekDay=6;

SET BrokenWeeks=1;

SET ReferenceDay=0;

SET FirstMonthOfYear=1;

SET CollationLocale='pt-BR';

LOAD

    Aeroporto,

    Nível,

    "Função Superior",

    Função,

    Gestor as Champion,

    Month(Mês) as Mês,

    Ano,

    "Tipo de Meta",

    "Valor Alvo",

    "Valor Real",

    "Peso da Meta",

    "% Atingido",

    "Peso Final",

    MêsID,

    MetaID

FROM [lib://BD (s-bria-qlikse01_ext-in)/GESTÃO DE METAS/Base Gestão de Metas 2016.xlsx]

(ooxml, embedded labels, table is [BD Metas Consolidadas]);

LOAD

    Título,

    Status,

    "Data de início",

    "Data limite",

    "Status Final",

    Gestor as Champion,

    "ID Status"

FROM [lib://BD (s-bria-qlikse01_ext-in)/GESTÃO DE METAS/Status Ações.xlsx]

(ooxml, embedded labels, table is Sheet0$);

undergrinder
Specialist II
Specialist II

Hi Marina,

At first sight the code is correct. The name of sheet in the second section is really Sheet0$?

I think the $ character is reserved for variables try enclose them in brackets.

LOAD

    Título,

    Status,

    "Data de início",

    "Data limite",

    "Status Final",

    Gestor as Champion,

    "ID Status"

FROM [lib://BD (s-bria-qlikse01_ext-in)/GESTÃO DE METAS/Status Ações.xlsx]

(ooxml, embedded labels, table is [Sheet0$]);

Or as isaaclin‌ said, try to comment out that section, and see what you get.

G.

Not applicable
Author

Hi, I tried to rename the sheet as BD and use [BD] in the code, then rename it back to Sheet0 and use Sheet0$ and [Sheet0] and none of those worked.

Sorry, I missed the comment out part, so here's what I did (got no error message after, it worked):

SET ThousandSep='.';

SET DecimalSep=',';

SET MoneyThousandSep='.';

SET MoneyDecimalSep=',';

SET MoneyFormat='R$ #.##0,00;-R$ #.##0,00';

SET TimeFormat='hh:mm:ss';

SET DateFormat='DD/MM/YYYY';

SET TimestampFormat='DD/MM/YYYY hh:mm:ss[.fff]';

SET MonthNames='jan;fev;mar;abr;mai;jun;jul;ago;set;out;nov;dez';

SET DayNames='seg;ter;qua;qui;sex;sáb;dom';

SET LongMonthNames='janeiro;fevereiro;março;abril;maio;junho;julho;agosto;setembro;outubro;novembro;dezembro';

SET LongDayNames='segunda-feira;terça-feira;quarta-feira;quinta-feira;sexta-feira;sábado;domingo';

SET FirstWeekDay=6;

SET BrokenWeeks=1;

SET ReferenceDay=0;

SET FirstMonthOfYear=1;

SET CollationLocale='pt-BR';

LOAD

    Aeroporto,

    Nível,

    "Função Superior",

    Função,

    Gestor as Champion,

    Month(Mês) as Mês,

    Ano,

    "Tipo de Meta",

    "Valor Alvo",

    "Valor Real",

    "Peso da Meta",

    "% Atingido",

    "Peso Final",

    MêsID,

    MetaID

FROM [lib://BD (s-bria-qlikse01_ext-in)/GESTÃO DE METAS/Base Gestão de Metas 2016.xlsx]

(ooxml, embedded labels, table is [BD Metas Consolidadas]);

//LOAD

//    Título,

//    Status,

//    "Data de início",

//    "Data limite",

//    "Status Final",

//    Gestor as Champion,

//    "ID Status"

//FROM [lib://BD (s-bria-qlikse01_ext-in)/GESTÃO DE METAS/Status Ações.xlsx]

//(ooxml, embedded labels, table is Sheet0$);

So the problem is in the second LOAD part? I have no idea what could be it since both databases are in the same folder and I think I applied the same code to both cases.

isaaclin
Contributor III
Contributor III

Sorry my Spanish is not good. Tried my best to read the statement..

I think since you narrowed down to the second statement , try load field one by one to see which part,

for example, only load Titulo, and bracket Sheet0$ as undergrinder  suggested

//LOAD

//    Título

//FROM [lib://BD (s-bria-qlikse01_ext-in)/GESTÃO DE METAS/Status Ações.xlsx]

//(ooxml, embedded labels, table is [Sheet0$]);

add one more field if this passed the test.

Good Luck