Filtrar con condiciones o extraer datos de una base de datos existente

Copper Contributor

Hola! Estoy teniendo dificultades para hacer una filtración debido a la cantidad de datos en la base que estoy trabajando.

 

Tengo una base con todas las colonias de mi país, incluyendo el estado, municipio, población en la colonia, entre otros datos.

 

Necesito filtrar o quitar las colonias (y sus filas) para solo quedarme con una sola colonia por municipio, dicha colonia es la que tiene la mayor población registrada.

Debido a la cantidad masiva de información he tenido problemas para quitar la información que no requiero. Prácticamente debo quedarme con una sola fila por municipio, esta fila es la que tiene la colonia con mayor población. 

1 Reply

@VibingBoy If I understood the translation correctly, you wish to extract the rows that contain the largest population number for each municipality. Using Power Query, this can be done fairly easily as you do not have to load the CSV file into an Excel sheet. The attached file contains a table of 2326 municipalities.

 

Now, you are probably not familiar with Power Query. Otherwise you would not have asked the question.  Since I connected to the CSV on my own computer, the file path will not work for you. In the attached file  I changed the file path to a folder C:\Users\ . Create one exactly like that on your own PC and put the CSV file in that folder. Then the queries should work. Now learn about Power Query. The link below is a good starting point for English speakers. Perhaps you can find a good resource in Spanish as well.

https://exceloffthegrid.com/power-query-introduction/