Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
mxell
Contributor III
Contributor III

Eliminar registros com colunas iguais

Tenho a seguinte tabela:

Dia Semana Valor
05/05/2023 18 10
10/06/2023 23 15
15/06/2023 24 13
16/06/2023 24 14

 

Gostaria de elimiar registros de datas já existentes baseando na semana. ex:

Dia Semana Item Valor
05/05/2023 18 A 10
10/06/2023 23 B 15
15/06/2023 24 C 13
16/06/2023 24 C 14

 

Existem dois registros para com semana e item igual. Preciso manter somente a última linha.

 

Labels (1)
1 Solution

Accepted Solutions
MatheusC
Specialist II
Specialist II

Oi, @mxell 

tente algo como neste exemplo: 

tab1:
load * Inline [
Diâmetro, Semana, Valentia
05/05/2023, 18, 10
06/10/2023, 23, 15
15/06/2023, 24, 13
16/06/2023, 24, 14
];

tab2:
NoConcatenate
Load Distinct
max(Diâmetro) as Diâmetro,
Semana as Semana
Resident tab1 Group By Semana;

Left Join(tab2)
Load
*
Resident tab1;

Drop Table tab1;

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!

View solution in original post

2 Replies
MatheusC
Specialist II
Specialist II

Oi, @mxell 

tente algo como neste exemplo: 

tab1:
load * Inline [
Diâmetro, Semana, Valentia
05/05/2023, 18, 10
06/10/2023, 23, 15
15/06/2023, 24, 13
16/06/2023, 24, 14
];

tab2:
NoConcatenate
Load Distinct
max(Diâmetro) as Diâmetro,
Semana as Semana
Resident tab1 Group By Semana;

Left Join(tab2)
Load
*
Resident tab1;

Drop Table tab1;

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
MatheusC
Specialist II
Specialist II

@mxell 

Feche o tópico com a solução aceita

Obrigado

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!