Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
eduardo_dimperio
Specialist II
Specialist II

Preceding Load Error

Hi,

I didnt quite understand precend load, so why when i run this code it works


ANALISE_FINAL:

LOAD

*

WHERE (ConsumoReal_0 > 0 AND ConsumoReal_1 > 0 AND ConsumoReal_2 > 0) AND (ConsumoReal_0 + ConsumoReal_1 + ConsumoReal_2>0.005);

LOAD

    HORA0,

    OID_METER,

    Sum(CONSUMODIA0)AS ConsumoReal_0,

    Sum(CONSUMODIA1)AS ConsumoReal_1,

    Sum(CONSUMODIA2)AS ConsumoReal_2

RESIDENT ANALISE

GROUP BY OID_METER,HORA0

ORDER BY HORA0;

and when i run this i receive this erros messagem:

ANALISE_FINAL:

LOAD

*

WHERE (ConsumoReal_0 > 0 AND ConsumoReal_1 > 0 AND ConsumoReal_2 > 0) AND (ConsumoReal_0 + ConsumoReal_1 + ConsumoReal_2>0.005);

LOAD

    HORA0,

    OID_METER,

    ID_LEITURA,

    NAME_SYSTEM,

    NAME_GROUP,

    NEIGHB_SYSTEM,

    CITY_SYSTEM,

    NAME_TYPE_METER,

    NAME_UC,

    ADDRESS_BLOCK_UC,

    Sum(CONSUMODIA0)AS ConsumoReal_0,

    Sum(CONSUMODIA1)AS ConsumoReal_1,

    Sum(CONSUMODIA2)AS ConsumoReal_2

RESIDENT ANALISE

GROUP BY OID_METER,HORA0

ORDER BY HORA0;

Ocorreram os seguintes erros:

Unknown error

O erro ocorreu aqui:

ANALISE_FINAL: LOAD * WHERE (ConsumoReal_0 > 0 AND ConsumoReal_1 > 0 AND ConsumoReal_2 > 0) AND (ConsumoReal_0 + ConsumoReal_1 + ConsumoReal_2>0.005)

I just put more variables, the logic i think still remains.

1 Solution

Accepted Solutions
santiago_respane
Specialist
Specialist

Hi mate,

it seems you didnt add those extra fields in the group by clause.

Your load statment should be something like this:

ANALISE_FINAL:

LOAD

*

WHERE (ConsumoReal_0 > 0 AND ConsumoReal_1 > 0 AND ConsumoReal_2 > 0) AND (ConsumoReal_0 + ConsumoReal_1 + ConsumoReal_2>0.005);

LOAD

    HORA0,

    OID_METER,

    ID_LEITURA,

    NAME_SYSTEM,

    NAME_GROUP,

    NEIGHB_SYSTEM,

    CITY_SYSTEM,

    NAME_TYPE_METER,

    NAME_UC,

    ADDRESS_BLOCK_UC,

    Sum(CONSUMODIA0)AS ConsumoReal_0,

    Sum(CONSUMODIA1)AS ConsumoReal_1,

    Sum(CONSUMODIA2)AS ConsumoReal_2

RESIDENT ANALISE

GROUP BY OID_METER,

                  HORA0,

                  D_LEITURA,

                  NAME_SYSTEM,

                  NAME_GROUP,

                  NEIGHB_SYSTEM,

                  CITY_SYSTEM,

                  NAME_TYPE_METER,

                  NAME_UC,

                  ADDRESS_BLOCK_UC

ORDER BY HORA0;

Let me know if this helps.

Kind regards,

View solution in original post

4 Replies
santiago_respane
Specialist
Specialist

Hi mate,

it seems you didnt add those extra fields in the group by clause.

Your load statment should be something like this:

ANALISE_FINAL:

LOAD

*

WHERE (ConsumoReal_0 > 0 AND ConsumoReal_1 > 0 AND ConsumoReal_2 > 0) AND (ConsumoReal_0 + ConsumoReal_1 + ConsumoReal_2>0.005);

LOAD

    HORA0,

    OID_METER,

    ID_LEITURA,

    NAME_SYSTEM,

    NAME_GROUP,

    NEIGHB_SYSTEM,

    CITY_SYSTEM,

    NAME_TYPE_METER,

    NAME_UC,

    ADDRESS_BLOCK_UC,

    Sum(CONSUMODIA0)AS ConsumoReal_0,

    Sum(CONSUMODIA1)AS ConsumoReal_1,

    Sum(CONSUMODIA2)AS ConsumoReal_2

RESIDENT ANALISE

GROUP BY OID_METER,

                  HORA0,

                  D_LEITURA,

                  NAME_SYSTEM,

                  NAME_GROUP,

                  NEIGHB_SYSTEM,

                  CITY_SYSTEM,

                  NAME_TYPE_METER,

                  NAME_UC,

                  ADDRESS_BLOCK_UC

ORDER BY HORA0;

Let me know if this helps.

Kind regards,

Anonymous
Not applicable

......try this ....? did you miss GROUPING  non-computing fields ?

......

...

ANALISE_FINAL:

LOAD

*

WHERE (ConsumoReal_0 > 0 AND ConsumoReal_1 > 0 AND ConsumoReal_2 > 0) AND (ConsumoReal_0 + ConsumoReal_1 + ConsumoReal_2>0.005);

LOAD

    HORA0,

    OID_METER,

    ID_LEITURA,

    NAME_SYSTEM,

    NAME_GROUP,

    NEIGHB_SYSTEM,

    CITY_SYSTEM,

    NAME_TYPE_METER,

    NAME_UC,

    ADDRESS_BLOCK_UC,

    Sum(CONSUMODIA0)AS ConsumoReal_0,

    Sum(CONSUMODIA1)AS ConsumoReal_1,

    Sum(CONSUMODIA2)AS ConsumoReal_2

RESIDENT ANALISE

GROUP BY OID_METER,HORA0,ID_LEITURA, NAME_SYSTEM, CITY_SYSTEM, NAME_TYPE_METER,  NAME_UC,DDRESS_BLOCK_UC,

ORDER BY HORA0;

julian_rodriguez
Partner - Specialist
Partner - Specialist

Hello Eduardo

You are aggregating the fields CONSUMODIA0, 1 y 2, so, you should add the new variables to the Group By sentence (

    ID_LEITURA,

    NAME_SYSTEM,

    NAME_GROUP,

    NEIGHB_SYSTEM,

    CITY_SYSTEM,

    NAME_TYPE_METER,

    NAME_UC,

    ADDRESS_BLOCK_UC,

Something like

ANALISE_FINAL:

LOAD

*

WHERE (ConsumoReal_0 > 0 AND ConsumoReal_1 > 0 AND ConsumoReal_2 > 0) AND (ConsumoReal_0 + ConsumoReal_1 + ConsumoReal_2>0.005);

LOAD

    HORA0,

    OID_METER,

    ID_LEITURA,

    NAME_SYSTEM,

    NAME_GROUP,

    NEIGHB_SYSTEM,

    CITY_SYSTEM,

    NAME_TYPE_METER,

    NAME_UC,

    ADDRESS_BLOCK_UC,

    Sum(CONSUMODIA0)AS ConsumoReal_0,

    Sum(CONSUMODIA1)AS ConsumoReal_1,

    Sum(CONSUMODIA2)AS ConsumoReal_2

RESIDENT ANALISE

GROUP BY OID_METER,HORA0,

    ID_LEITURA,

    NAME_SYSTEM,

    NAME_GROUP,

    NEIGHB_SYSTEM,

    CITY_SYSTEM,

    NAME_TYPE_METER,

    NAME_UC,

    ADDRESS_BLOCK_UC

ORDER BY HORA0;

Regards!

eduardo_dimperio
Specialist II
Specialist II
Author

Hi everyone,

Thanks for the help, when i saw unknown error following by preceding load code part i didnt pay attention in rest of code but this.

Problem solve