0

# Function distance ?

Oct 17, 2017 at 07:12 AM

97

Former Member

Hello,

I would like to calculate the distance between 2 GPS coordinates. So, I would like create a new column containing a function. Can you help me please ?

Thanks

Could you share sample screen shots/data for this?

Former Member

test3.png

I would like to calculate in a new column the distance between Grenoble AND the agency, and the distance between Lyon AND the agency.

Thank you

test3.png (6.3 kB)

Tammy Powlas
Oct 18, 2017 at 01:27 PM
1

Show 5 Share
Former Member

Yes, but I don't find what I search...

I would like for example put bubbles in the map : if the distance between town A and town reference >5 then red, else green.

Ah, how about calculating the distance in the model and then creating conditional formatting in the chart?

Former Member

Yes it will be perfect ! I have think to do this, putting the new measure "distance" in the bubble color. But in the model, how add a new calculated column ?

Else, I add this measure in the Excel model.

Hi Lucile - unfortunately (to my knowledge) there is no remodeling, so you will need to recreate the model to create the calculation

Former Member

Ok, thank you very much for your help.

Former Member
Oct 20, 2017 at 05:28 PM
1

Lucile,

I am not sure how you want to use the distance result but I would suggest you have 2 approaches. One is to pre calculate the distance from Agencie to the Cities, then add a property to that dimension which stores the difference, but is reportable as an attribute. The other approach involves adding Latitude and Longitude as accounts. Add an account called Distance to Agencie. Then using either model account calculation logic or story calculation logic to derive the distance as a measure/account. I don't know the formula to build the distance calculation, but assume it may be quite involved.

Hope this helps.

Petar

Show 3 Share
Former Member

Hello, I don't understand the first approach. Can you give me an example please ?

Thanks

Former Member

If you have a model that is acquiring data (stored in SAC) and the model has been built in SAC, then you may add a property to any dimension that is in the model. Click on the model to open, click the dimension, Add Column header name, then save the model. My though was to add a property called "DistanceToAgencie", then in the column, add the distance value that you have calculated outside of SAC. The properties may then be viewed in the Story. It will not be a value from a calculation or that may be used in a calculation, but it would be able to be viewed.

If you want to calculate a value, that will need to be done in the Account dimension, and is a different process.

Former Member

Thank you for your answer. But I will explain to you my need.

I have an agency (which is my referency place) : Paris (with its GPS coordinates)

And I have others agencies in France : Lyon, Grenoble, Strasbourg, Marseille . These cities have also GPS coordinates.

I would like to put all these cities in a map, and to put the cities which have a maximal distance of 200 km with the agency of Paris (referency) in green, and the others in red.

Thanks

John Leggio
Feb 14 at 06:10 PM
1

Hi Lucile,

Were you able to figure this out?

You could try having all the locations as a red Point of Interest (POI) layer, then the ones within 200km as a separate green bubble layer over the POI. Could resize the bubbles so that they cover/hide the POI icon. To get the ones that are 200km on the bubble layer, you can set a static map distance filter (no input control) on the geomap, it won’t filter out the POI so don’t have to worry about that.

Disadvantage here is that you won’t be able to put measures on a POI.

Share