1 Reply Latest reply: Dec 29, 2016 7:13 AM by Eduardo DImperio RSS

    Mergin Fields

    Eduardo DImperio

      Hey Everione,

       

      About this code i get the result that o want to

       

      Corrige_Medidor:

       

       

      LOAD

      DISTINCT

      OID_METER,

      VALUE_READ AS VALOR,

      DATE_READ

      RESIDENT TMP2

       

      ORDER BY OID_METER,DATE_READ DESC ;

       

      NoConcatenate

       

      Exclude_Meter:

       

      LOAD

      DISTINCT

      OID_METER,

      VALOR,

      PEEK(VALOR),

      IF(VALOR - PEEK(VALOR)=0,OID_METER) AS EXCLUIR,

      DATE_READ

      RESIDENT Corrige_Medidor

      ORDER BY OID_METER,DATE_READ DESC ;

       

      drop table Corrige_Medidor;

       

      Exclusao:

      LOAD

        OID_METER,

          EXCLUIR

          RESIDENT Exclude_Meter

          WHERE Isnull(EXCLUIR)=0

          ORDER BY OID_METER;

       

      And i get this result:

       

      Peek.JPG

      But now i need to pick just the values on OID_METER that doent have correspondent on EXCLUIR.

      I tried this:

       

      Exclusao2:

      LOAD

        OID_METER,

          EXCLUIR

          RESIDENT Exclude_Meter

          WHERE Isnull(EXCLUIR)=-1

          ORDER BY OID_METER;

       

      and this:

       

      Exclusao2:

      LOAD

        OID_METER,

          EXCLUIR

          RESIDENT Exclude_Meter

          WHERE  EXCLUIR <> OID_METER

          ORDER BY OID_METER;

       

      even this:

       

      Exclusao2:

      LOAD

        OID_METER,

          EXCLUIR,

      If (not exists (OID_METER,EXCLUIR)=-1, OID_METER)

          RESIDENT Exclude_Meter

          ORDER BY OID_METER;

       

      but nothing worked. My OID_METER returns no record.

       

      Someone could help me?