Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Luis-DataIQ
Contributor II
Contributor II

Problemas con datos repetidos

Buenas tardes, tengo un inconveniente con datos repetidos en una de mis tablas DIMENSION que se llama "SELECCION". Mi modelo final es el siguiente.

 

LuisDataIQ_1-1653678320682.png

Mi tabla "SELECCION" nace de mi tabla "PARTIDO" donde tengo los datos repetidos que no se como solucionarlo. y los tengo asi: 

LuisDataIQ_2-1653678459904.png

El script de mi tabla "SELECCION" que no se si esta bien me quedo asi:

SELECCION:
Load Distinct
ID_PARTIDO,
GRUPO,
PAIS_LOCAL                               AS ID_PAIS,
'Local'                                           AS LV

Resident PARTIDO;

Concatenate(SELECCION)
Load Distinct
ID_PARTIDO,
GRUPO,
PAIS_VISITANTE                                  AS ID_PAIS,
'Visitante'                                               AS LV

Resident PARTIDO;

 

Muchas Gracias!

 

 

Labels (6)
1 Solution

Accepted Solutions
Luis-DataIQ
Contributor II
Contributor II
Author

Muchas gracias por sus respuestas. Al final pude solucionar mi problema aplicando un Order By por ID_Partido.

 

Saludos!

View solution in original post

3 Replies
HugoRomeira_PT
Creator
Creator

Hola,

Veo que ya haces lo distinct lo que te elimina datos repetidos, por eso creo que  un de los campos te resulta en algo distinto

Lo unico campo que no veo en tu printscreen es el ID PAIS, entonces creo que puede ser ai que tienes el problema.

 

Propongo:

SELECCION:
Load Distinct
ID_PARTIDO,
GRUPO,
PAIS_LOCAL                               AS ID_PAIS,
'Local'                                           AS LV

Resident PARTIDO

Where PAIS_LOCAL <>PAIS_VISITANTE;

Concatenate(SELECCION)
Load Distinct
ID_PARTIDO,
GRUPO,
PAIS_VISITANTE                                  AS ID_PAIS,
'Visitante'                                               AS LV

Resident PARTIDO

Where PAIS_LOCAL <>PAIS_VISITANTE

;

 

 

If the issue is solved please mark the answer with Accept as Solution.
If you want to go quickly, go alone. If you want to go far, go together.
vinieme12
Champion III
Champion III

This is correct,

This is being done to provide all country names in one field instead of having two separate country fields visitors/ local 

Having the country filter in one field and then a classification field that specifiies if it's a visitor or local will simplify your calculations 

For example 

Count of something for Uruguay where it is classified as local or visitor, users can just select Uruguay from id_pais 

And you can count both simultaneously

Count({<LV={'local'}>}something)

Count({<LV={'visitor'}>}something)

 

If you would have separate filters then the users would need to filter each field separately and you won't to be able to calculate local or visitor metrics for a country country simultaneously

 

You don't need any changes here

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Luis-DataIQ
Contributor II
Contributor II
Author

Muchas gracias por sus respuestas. Al final pude solucionar mi problema aplicando un Order By por ID_Partido.

 

Saludos!