Lat Long concatenation

Hi there!
I had this Lat and Long columns values, I try to concatenate them so I can Map them from a LatLong column but it seems that is not working, any comments on how can I transform this data so I can Pin Map them as Latlong?

[LATITUDE] -26.406.342.000.000.000
[LONGITUDE] 153.083.711.000.000.000

0 24 1,512
24 REPLIES 24

@Aparicio_Pineyrua can you try with this?

CONCATENATE(
IFS(
AND(LEFT([LATITUDE],1)="-",FIND(".",[LATITUTE])=4),
SUBSTITUTE(RIGHT(LEFT([LATITUDE],11),4),".",""),
AND(LEFT([LATITUDE],1)="-",FIND(".",[LATITUTE])=5),
SUBSTITUTE(RIGHT(LEFT([LATITUDE],12),4),".",""),
TRUE,
IFS(
FIND(".",[LATITUDE])=3,
SUBSTITUTE(RIGHT(LEFT([LATITUDE],10),4),".",""),
FIND(".",[LATITUDE])=4,
SUBSTITUTE(RIGHT(LEFT([LATITUDE],11),4),".","")
)),
", ",
IFS(
AND(LEFT([LONGITUDE],1)="-",FIND(".",[LONGITUDE])=4),
SUBSTITUTE(RIGHT(LEFT([LONGITUDE],11),4),".",""),
AND(LEFT([LONGITUDE],1)="-",FIND(".",[LONGITUDE])=5),
SUBSTITUTE(RIGHT(LEFT([LONGITUDE],12),4),".",""),
TRUE,
IFS(
FIND(".",[LONGITUDE])=3,
SUBSTITUTE(RIGHT(LEFT([LONGITUDE],10),4),".",""),
FIND(".",[LONGITUDE])=4,
SUBSTITUTE(RIGHT(LEFT([LONGITUDE],11),4),".","")
))
)

Every occurrence of LEFT() appears to be missing a length.

Thanks for the input @Steve. Can you explain why?

Shouldnโ€™t LEFT([LATITUDE]) be LEFT([LATITUDE], 1)?

SUBSTITUTE(RIGHT(LEFT([LONGITUDE]),11),4) has no length for LEFT(), a length of 11 for RIGHT(), and 4 goes to SUBSTITUTE().

Good catch @Steve, TY! From the mobile I might have lost the total command. Corrected the 1st part, and now check for the 2nd. Appreciated.

@Steve
I believe I have corrected the expression. May I kindly request from you to take a look at it now? From a 5.5" screen itโ€™s a bit hard you know. Thanks.

I understand! Iโ€™ll take a look.

With some corrections and reformatted for clarity:

CONCATENATE(
  IFS(
    AND(
      (LEFT([LATITUDE], 1) = "-"),
      (FIND(".", [LATITUDE]) = 4)
    ),
      SUBSTITUTE(RIGHT(LEFT([LATITUDE], 11), 4), ".", ""),
    AND(
      (LEFT([LATITUDE], 1) = "-"),
      (FIND(".", [LATITUDE]) = 5)
    ),
      SUBSTITUTE(RIGHT(LEFT([LATITUDE], 12), 4), ".", ""),
    (FIND(".", [LATITUDE]) = 3),
      SUBSTITUTE(RIGHT(LEFT([LATITUDE], 10), 4), ".", ""),
    (FIND(".", [LATITUDE]) = 4),
      SUBSTITUTE(RIGHT(LEFT([LATITUDE], 11), 4), ".", "")
  ),
  ", ",
  IFS(
    AND(
      (LEFT([LONGITUDE], 1) = "-"),
      (FIND(".", [LONGITUDE]) = 4)
    ),
      SUBSTITUTE(RIGHT(LEFT([LONGITUDE], 11), 4), ".", ""),
    AND(
      (LEFT([LONGITUDE], 1) = "-"),
      (FIND(".", [LONGITUDE]) = 5)
    ),
      SUBSTITUTE(RIGHT(LEFT([LONGITUDE], 12), 4), ".", ""),
    (FIND(".", [LONGITUDE]) = 3),
      SUBSTITUTE(RIGHT(LEFT([LONGITUDE], 10), 4), ".", ""),
    (FIND(".", [LONGITUDE]) = 4),
      SUBSTITUTE(RIGHT(LEFT([LONGITUDE], 11), 4), ".", "")
  )
)

Thanks @Steve, highly appreciated! I believe

", ".

is missing between 2 IFS statements inside the CONCATENATE as the syntax/format shall be:

(Lat, Long)

Fixed.

Thanks @LeventK and @Steve but for some reason is not working.
I try changing the columns Lat and Long for text and numeric and is not showing the pins in the Map form the LatLong column with this formula.

@Aparicio_Pineyrua
I believe you need to wrap all expressions of SUBSTITUTE(โ€ฆ) with DECIMAL()

DECIMAL(SUBSTITUTE(......))

Steve
Platinum 4
Platinum 4

Have you tried:

LATLONG([LATITUDE], [LONGITUDE])

Yes I try allready and is not working.
I aslo change the format of the columns in both side, donยดt understand why is not working.

The LATITUDE and LONGITUDE columns should be of type Decimal, not Number or Text.

Steve
Platinum 4
Platinum 4

In the lat and long you provided, where does the decimal point occur?

I try decimal all ready.
LAT -27.830.347.496.399.400,00
LONG 152.088.817.968.540.000,00

27.830.347.496.399.400,00 and 152.088.817.968.540.000,00 are not valid, I donโ€™t believe. Try 27,8303474963994 and 152,08881796854 instead.

@Aparicio_Pineyrua
If these are correct values than you need to divide them by 10^15 as they are totally out of range with these values.

@Aparicio_Pineyrua
I would suggest trying with this:

LATLONG(
DECIMAL([LATITUDE]/1000000000000000), 
DECIMAL([LONGITUDE]/1000000000000000)
)

OR simply

LATLONG(
[LATITUDE]/1000000000000000.00,
[LONGITUDE]/1000000000000000.00
)

Will try thanks!

Itยดs working but is not been accurate in the map.

@Aparicio_Pineyrua
It might be because of the decimal place approximation. Try with this and verify the result:

LATLONG(
[LATITUDE]/1000000000000000.00000000,
[LONGITUDE]/1000000000000000.00000000
)

With 2 significant digits, your coordinates will look like:
LATLONG(-96.21, 153.85)
In above expression, I have raised the significant digits to 8, so they will look like:
LATLONG(27.83034749, 152.08881796)

Also remember this; Iโ€™m not aware how and from where/what kind of resource you get those LAT and LONG values, but the GPS coordinate capture differs from device to device. Most accurate ones are always the GPS devices. Mobile phones (eventhough they have a small GPS module) uses the triangulation method to calculate the location where the base data is captured from the GSM network stations. Only military grade GPS devices have the proximity up to 50cm.

Top Labels in this Space