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: 
cguariente2
Contributor
Contributor

Criar uma nova tabela com diferenças entre campos entre duas tabelas

Pessoal, boa tarde!

Estou iniciando um novo aplicativo Qlikview mas estou com duvidas em relação à criação de uma nova tabela contendo registro de valores de campos diferentes.

 Tenho duas planilhas com estruturas idênticas, tenho que equiparam a chave produto e listar se existem diferenças entre os outros campos tabela esses Largura, Altura, Comprimento e Peso, para o produto iguais.

Se alguém puder ajudar agradeço.

Muito obrigado

 

 

 

Labels (1)
1 Solution

Accepted Solutions
cguariente2
Contributor
Contributor
Author

Juan

Thank you very much for the help, it worked properly.

Thank you very much

A strong hug

View solution in original post

2 Replies
JuanGerardo
Partner - Specialist
Partner - Specialist

Olá @cguariente2,

Allow me to respond in English, as my português is very limited to answer.

I think you have to load both tables with different names (Tab1 and Tab2) for the same fields (except Produto, to allow the join), then do an outer join to have all combinations (All table), and finally compare every record to have what you want (Compare table) and create the Equal field with the result of the comparison. Here is the load script:

Tab1:
LOAD
Produto,
True() AS Origen1,
Largura AS Largura1,
Altura AS Altura1,
Comprimento AS Comprimento1,
Peso AS Peso1
FROM [lib://Temp/tabela01.xlsx]
(ooxml, embedded labels, table is Data);

Tab2:
NoConcatenate
LOAD
Produto,
True() AS Origen2,
Largura AS Largura2,
Altura AS Altura2,
Comprimento AS Comprimento2,
Peso AS Peso2
FROM [lib://Temp/tabela02.xlsx]
(ooxml, embedded labels, table is Data);


All:
NoConcatenate
Load *
Resident Tab1;

Outer Join

Load *
Resident Tab2;


Drop Tables Tab1, Tab2;


Compare:
Load
*,
If(IsNull(Origen1), 'Only in Tab2',
If(IsNull(Origen2), 'Only in Tab1',
'Common')) AS Origin,
If(Not IsNull(Origen1) and Not IsNull(Origen2),
If(Largura1 & Altura1 & Comprimento1 & Peso1 = Largura2 & Altura2 & Comprimento2 & Peso2,
'Equal',
'Different'),
'Not Common') AS Equal
Resident All;

Drop Table All;

And here an example of the result:

JuanGerardo_0-1619458616034.png

 

I hope this is useful for you,

JG

cguariente2
Contributor
Contributor
Author

Juan

Thank you very much for the help, it worked properly.

Thank you very much

A strong hug