6 Replies Latest reply on Nov 1, 2016 8:46 AM by Shawn Wallwork

# Tableau Changing Longitude [Decimal Degrees]

Hi,

I am having troubled plotting a simple map in tableau. When I create the calculated fields.

Latitude:

[LATITUDE_DEG])+([LATITUDE_MIN]/60)+([LATITUDE_SEC]/3600)

Longitude:

-(([LONGITUDE_DEG])+([LONGITUDE_MIN]/60)+([LONGITUDE_SEC]/3600))

On my map, the Longitude is incorrect by 1 number. (Should be -113 [Alberta, Canada] and it converts to -112 or 112 [Russia])

I have attached my doc and twbx. Can anyone recommend a solution?

Thanks

• ###### 1. Re: Tableau Changing Longitude [Decimal Degrees]

hi Katie,

So I think this that on the Longitude it's that the negative sign is applied to the whole calculation...so is

-113+0.5+0.05 which equals -112.45 and then this has it's sign reversed to give 112.45

So you need to put the "minus sign" inside the LONGITUDE_DEG part too...so

-(([LONGITUDE_DEG]*-1)+([LONGITUDE_MIN]/60)+([LONGITUDE_SEC]/3600))

Hopefully, that does the trick

• ###### 2. Re: Tableau Changing Longitude [Decimal Degrees]

Hi Simon,

I suppose my issue is more whether I am converting the data correctly. When plotted, I know the data is too far East.

Maybe the calculated field is not necessary and I can use the coordinates given somehow?

• ###### 3. Re: Tableau Changing Longitude [Decimal Degrees]

It's probably easier just to subtract the minutes and second since they're stored as positive numbers:

--Shawn

• ###### 4. Re: Tableau Changing Longitude [Decimal Degrees]

Here's what the map looks like:

You certainly seem to be doing the calc correctly (except the mixed +/- signs in your data.)

--Shawn

• ###### 5. Re: Tableau Changing Longitude [Decimal Degrees]

Thanks Shawn.

I played around with the (+/-) signs and it seems to be correct now....

This is what I have.

• ###### 6. Re: Tableau Changing Longitude [Decimal Degrees]

That really doesn't look right, I doubt the latitudes line up like that. See the difference between my map screenshot and your's. I'm attaching your workbook. I only changed the + to - for the longitude conversion calc. I didn't touch anything else.

--Shawn