4 Replies Latest reply: Dec 15, 2016 2:54 PM by Massimo Grossi RSS

    Precend Load Problem

    Eduardo DImperio

      Hi Everyone

       

      Im trying use precend load.

      In this case i using group by for HORA0 at the same time its created,i thought that only put load everything before solve the problem, but not. Can someone help me please?

       

      ANALISE:

      LOAD

      *;

      LOAD

          DISTINCT HOUR(HORA) AS HORA0,

        ID_LEITURA,

          NAME_SYSTEM,

          NAME_GROUP,

          NEIGHB_SYSTEM,

          CITY_SYSTEM,

          OID_METER,

          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_TMP

          GROUP BY

          HORA0,

          ID_LEITURA,

          NAME_SYSTEM,

          NAME_GROUP,

          NEIGHB_SYSTEM,

          CITY_SYSTEM,

          OID_METER,

          NAME_TYPE_METER,

          NAME_UC,

          ADDRESS_BLOCK_UC;

       

       

      Ocorreram os seguintes erros:

      Field not found - <HORA0>

      O erro ocorreu aqui:

      LOAD DISTINCT HOUR(HORA) AS HORA0, ID_LEITURA, NAME_SYSTEM, NAME_GROUP, NEIGHB_SYSTEM, CITY_SYSTEM, OID_METER, 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_TMP GROUP BY HORA0, ID_LEITURA, NAME_SYSTEM, NAME_GROUP, NEIGHB_SYSTEM, CITY_SYSTEM, OID_METER, NAME_TYPE_METER, NAME_UC, ADDRESS_BLOCK_UC

        • Re: Precend Load Problem
          Sunny Talwar

          I don't think you need a preceding load here, try this:

           

          ANALISE:

          LOAD

              DISTINCT HOUR(HORA) AS HORA0,

            ID_LEITURA,

              NAME_SYSTEM,

              NAME_GROUP,

              NEIGHB_SYSTEM,

              CITY_SYSTEM,

              OID_METER,

              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_TMP

              GROUP BY

              HORA,

              ID_LEITURA,

              NAME_SYSTEM,

              NAME_GROUP,

              NEIGHB_SYSTEM,

              CITY_SYSTEM,

              OID_METER,

              NAME_TYPE_METER,

              NAME_UC,

              ADDRESS_BLOCK_UC;

          • Re: Precend Load Problem
            Massimo Grossi

            ANALISE:

            LOAD

            *;

            LOAD

              HOUR(HORA) AS HORA0,

              ID_LEITURA,

                NAME_SYSTEM,

                NAME_GROUP,

                NEIGHB_SYSTEM,

                CITY_SYSTEM,

                OID_METER,

                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_TMP

                GROUP BY

                HOUR(HORA),

                ID_LEITURA,

                NAME_SYSTEM,

                NAME_GROUP,

                NEIGHB_SYSTEM,

                CITY_SYSTEM,

                OID_METER,

                NAME_TYPE_METER,

                NAME_UC,

                ADDRESS_BLOCK_UC;