Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
marciomgm
Creator
Creator

Count valores nulos em tabelas diferentes

Como faço para contar valores que existem em uma tabela mas não existem em uma determinada tabela?

Tenho as seguintes tabelas:

Tabela(1):

A,

B,

C,

D

Tabela(2):

A,

A,

A,

C,

C,

Gostaria de exibir através de um objeto texto o resultado = 2, sendo os valores não encontrados na tabela (2), ou seja, B e D

1 Solution

Accepted Solutions
simonc-cfn
Contributor III
Contributor III

Try the following...

=======================

Table1:

LOAD * INLINE [

key,Table1_Val

A,A

B,B

C,C

D,D

]

;

join

//Table2:

LOAD * INLINE [

key,Table2_Val

A,A

A,A

A,A

C,C

C,C

]

;

aggr:

Load

key,Table1_Val,

Table2_Val,

if(isnull(Table2_Val),1,0) as NullValueFlag,

if(isnull(Table2_Val),key,Null()) as NullValue

resident Table1

;

drop table Table1;

=========================

o en tu idioma... 

============================

Tente o seguinte ...

Tabela 1:

CARGA * INLINE [

chave , Table1_Val

A, A

B , B

C, C

D , D

]

;

juntar

// Tabela2 :

CARGA * INLINE [

chave , Table2_Val

A, A

A, A

A, A

C, C

C, C

]

;

aggr :

carga

chave , Table1_Val ,

Table2_Val ,

se ( isnull ( Table2_Val ) , 1,0) como NullValueFlag ,

if ( isnull ( Table2_Val ) , chave, Null ()) como NullValue

residente Table1

;

drop table Tabela 1 ;

===============================

Avisas si ayude.

Simon

View solution in original post

2 Replies
simonc-cfn
Contributor III
Contributor III

Try the following...

=======================

Table1:

LOAD * INLINE [

key,Table1_Val

A,A

B,B

C,C

D,D

]

;

join

//Table2:

LOAD * INLINE [

key,Table2_Val

A,A

A,A

A,A

C,C

C,C

]

;

aggr:

Load

key,Table1_Val,

Table2_Val,

if(isnull(Table2_Val),1,0) as NullValueFlag,

if(isnull(Table2_Val),key,Null()) as NullValue

resident Table1

;

drop table Table1;

=========================

o en tu idioma... 

============================

Tente o seguinte ...

Tabela 1:

CARGA * INLINE [

chave , Table1_Val

A, A

B , B

C, C

D , D

]

;

juntar

// Tabela2 :

CARGA * INLINE [

chave , Table2_Val

A, A

A, A

A, A

C, C

C, C

]

;

aggr :

carga

chave , Table1_Val ,

Table2_Val ,

se ( isnull ( Table2_Val ) , 1,0) como NullValueFlag ,

if ( isnull ( Table2_Val ) , chave, Null ()) como NullValue

residente Table1

;

drop table Tabela 1 ;

===============================

Avisas si ayude.

Simon

marciomgm
Creator
Creator
Author

Perfeito! funcionou!

gracias!