Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
fftec_fftec
Partner - Contributor II
Partner - Contributor II

Return only one line

Hello people,
I have a table that has several latitude and longitude for the same neighborhood, and I want to bring only one latitude for that neighborhood.
In the script.
How can I do this?
example:

State, city, neighborhood, latitude, longitude
RJ,MARICA,ARACATIBA,-22.9443768,-42.8307626
RJ,MARICA,ARACATIBA,-22.9444643,-42.8258943
RJ,MARICA,ARACATIBA,-22.9543803,-42.9545308
RJ,MARICA,BARRA DE MARICA,-22.9126326,-42.8067086
RJ,MARICA,BARRA DE MARICA,-22.9209483,-42.8152023
RJ,MARICA,CAXITO,-22.8775797,-42.8093939
RJ,MARICA,CAXITO,-22.8793234,-42.8036853
RJ,MARICA,CAXITO,-22.8816847,-42.8035496
RJ,MARICA,CENTRO,-22.8019154,-42.9609395
RJ,MARICA,CENTRO,-22.8942135,-43.7220240
RJ,MARICA,CENTRO,-22.9209483,-42.8152023
RJ,MARICA,CONDADO DE MARICA,-22.8558192,-43.5348594
RJ,MARICA,CONDADO DE MARICA,-22.8832243,-43.6177629
RJ,MARICA,CONDADO DE MARICA,-22.8853351,-43.5876264
RJ,MARICA,FLAMENGO,-22.9081358,-42.8071178
RJ,MARICA,FLAMENGO,-22.9126326,-42.8067086
RJ,MARICA,ITAPEBA,-22.9029925,-42.8213884
RJ,MARICA,ITAPEBA,-22.9030370,-42.8250120

 

And I need it to look like this:
State, city, neighborhood, latitude, longitude
RJ,MARICA,ARACATIBA,-22.9443768,-42.8307626
RJ,MARICA,BARRA DE MARICA,-22.9126326,-42.8067086
RJ,MARICA,CAXITO,-22.8775797,-42.8093939
RJ,MARICA,CENTRO,-22.8019154,-42.9609395
RJ,MARICA,CONDADO DE MARICA,-22.8558192,-43.5348594
RJ,MARICA,FLAMENGO,-22.9081358,-42.8071178
RJ,MARICA,ITAPEBA,-22.9029925,-42.8213884

That is, one latitude and longitude per neighborhood

Labels (1)
1 Solution

Accepted Solutions
Taoufiq_Zarra
MVP
MVP

Maye be attached

Data:

load * inline [
State, city, neighborhood, latitude, longitude
RJ,MARICA,ARACATIBA,-22.9443768,-42.8307626
RJ,MARICA,ARACATIBA,-22.9444643,-42.8258943
RJ,MARICA,ARACATIBA,-22.9543803,-42.9545308
RJ,MARICA,BARRA DE MARICA,-22.9126326,-42.8067086
RJ,MARICA,BARRA DE MARICA,-22.9209483,-42.8152023
RJ,MARICA,CAXITO,-22.8775797,-42.8093939
RJ,MARICA,CAXITO,-22.8793234,-42.8036853
RJ,MARICA,CAXITO,-22.8816847,-42.8035496
RJ,MARICA,CENTRO,-22.8019154,-42.9609395
RJ,MARICA,CENTRO,-22.8942135,-43.7220240
RJ,MARICA,CENTRO,-22.9209483,-42.8152023
RJ,MARICA,CONDADO DE MARICA,-22.8558192,-43.5348594
RJ,MARICA,CONDADO DE MARICA,-22.8832243,-43.6177629
RJ,MARICA,CONDADO DE MARICA,-22.8853351,-43.5876264
RJ,MARICA,FLAMENGO,-22.9081358,-42.8071178
RJ,MARICA,FLAMENGO,-22.9126326,-42.8067086
RJ,MARICA,ITAPEBA,-22.9029925,-42.8213884
RJ,MARICA,ITAPEBA,-22.9030370,-42.8250120
];

output:
NoConcatenate
load State,city,neighborhood,FirstValue(latitude) as latitude ,FirstValue(longitude) as longitude resident Data Group By State,city,neighborhood;

drop table Data;

 

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

1 Reply
Taoufiq_Zarra
MVP
MVP

Maye be attached

Data:

load * inline [
State, city, neighborhood, latitude, longitude
RJ,MARICA,ARACATIBA,-22.9443768,-42.8307626
RJ,MARICA,ARACATIBA,-22.9444643,-42.8258943
RJ,MARICA,ARACATIBA,-22.9543803,-42.9545308
RJ,MARICA,BARRA DE MARICA,-22.9126326,-42.8067086
RJ,MARICA,BARRA DE MARICA,-22.9209483,-42.8152023
RJ,MARICA,CAXITO,-22.8775797,-42.8093939
RJ,MARICA,CAXITO,-22.8793234,-42.8036853
RJ,MARICA,CAXITO,-22.8816847,-42.8035496
RJ,MARICA,CENTRO,-22.8019154,-42.9609395
RJ,MARICA,CENTRO,-22.8942135,-43.7220240
RJ,MARICA,CENTRO,-22.9209483,-42.8152023
RJ,MARICA,CONDADO DE MARICA,-22.8558192,-43.5348594
RJ,MARICA,CONDADO DE MARICA,-22.8832243,-43.6177629
RJ,MARICA,CONDADO DE MARICA,-22.8853351,-43.5876264
RJ,MARICA,FLAMENGO,-22.9081358,-42.8071178
RJ,MARICA,FLAMENGO,-22.9126326,-42.8067086
RJ,MARICA,ITAPEBA,-22.9029925,-42.8213884
RJ,MARICA,ITAPEBA,-22.9030370,-42.8250120
];

output:
NoConcatenate
load State,city,neighborhood,FirstValue(latitude) as latitude ,FirstValue(longitude) as longitude resident Data Group By State,city,neighborhood;

drop table Data;

 

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉