Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
eduardo_dimperio
Specialist II
Specialist II

Mergin Fields

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?

1 Solution

Accepted Solutions
eduardo_dimperio
Specialist II
Specialist II
Author

Hi,

I understand what im doing wrong

The problem was here

Exclusao:

LOAD

    OID_METER,

    EXCLUIR

    RESIDENT Exclude_Meter

    WHERE NOT EXISTS(EXCLUIR,OID_METER)=-1

    ORDER BY EXCLUIR;

  

DROP TABLE Exclude_Meter;

View solution in original post

1 Reply
eduardo_dimperio
Specialist II
Specialist II
Author

Hi,

I understand what im doing wrong

The problem was here

Exclusao:

LOAD

    OID_METER,

    EXCLUIR

    RESIDENT Exclude_Meter

    WHERE NOT EXISTS(EXCLUIR,OID_METER)=-1

    ORDER BY EXCLUIR;

  

DROP TABLE Exclude_Meter;