1 2 Previous Next 24 Replies Latest reply on Sep 14, 2019 8:37 AM by Don Wise Go to original post
      • 15. Re: Maps - Mileage
        Michael Kaminski

        Do I have to create the parameters first?

         

        The parameters that you created, did that generate the "Starting" and "Ending" Latitude and Longitude calculated measures?

         

        I was hoping to do just one big calculation in which I entered the actual Latitude and Longitude values for one staring point and the used my [Zips] field to provide the distances from my one starting point to every other zip.  Is that possible?  How would you write that?

        • 16. Re: Maps - Mileage
          Michael Kaminski

          I just want to write a formula using one starting point, one zip code.  I assume I would need to put the longitude and latitude coordinates (numbers) into a formula.  I'd like to drag in the field [Zips] into the formula so that a mileage calculation is made is made from my one staring point (zip) to the other zip code values in my [Zips] field.  How do I write that formula? I attached a sheet with the zip codes, the highlight zip is my beginning point and I want to know how far the other zip codes are from this (highlighted) starting zip code.

          • 17. Re: Maps - Mileage
            Michael Kaminski

            I just want to write a formula using one starting point, one zip code.  I assume I would need to put the longitude and latitude coordinates (numbers) into a formula.  I'd like to drag in the field  into the formula so that a mileage calculation is made is made from my one staring point (zip) to the other zip code values in my  field.  How do I write that formula? I attached a sheet with the zip codes, the highlight zip is my beginning point and I want to know how far the other zip codes are from this (highlighted) starting zip code.

             

            What is the format for using coordinates in a formula?

            • 18. Re: Maps - Mileage
              Don Wise

              Hi Michael,

              I don't think it's going to be that simple...do you have a set of zip codes (with Lat/Long) in addition to your starting zip code that you want to evaluate? There will need to be an anchor zip code which is your starting zip and that will likely need to be a parameter.  I don't see any other zip code data in the .csv  Best, Don

              • 19. Re: Maps - Mileage
                Michael Kaminski

                This seems to work:

                 

                3959  * ACOS

                (

                SIN(RADIANS(39.989700)) * SIN(RADIANS((AVG()))) +

                COS(RADIANS(39.989700)) * COS(RADIANS((AVG()))) *

                COS(RADIANS((AVG()))-RADIANS(-82.809300))

                )

                 

                I use one, specific, Latitude and one, specific, longitude for the zip code where I am measuring from. Then, within the formula, I use the coordinates for the other values (the other zip codes).

                 

                What do you think?

                • 20. Re: Maps - Mileage
                  Don Wise

                  Hi Michael,

                  I tried something and it didn't play out well when changing Zip Codes. It came from the following thread and I simply duplicated it with zip codes from your area:  Distance Mapping with Radius Filter 

                   

                  Maybe your own answer is the best!  Best, Don

                   

                  It displayed a map and a central starting point, but when the zip code was updated, the point would move appropriately to the correct area, but the related mileage didn't change correctly for all values surrounding the new zip code value:

                  Screen Shot 2019-09-12 at 3.19.36 PM.png

                  Same for the cross table.

                  Screen Shot 2019-09-12 at 3.20.10 PM.png

                  • 21. Re: Maps - Mileage
                    Don Wise

                    Hi Michael,

                    I took a different approach and got the results I was looking for.  What I wanted to give you was a more automated method so that you can select the anchor Zip Code and then a radius (miles) and get all zip codes and their respective miles from the anchor Zip Code. Your hard-coded approach probably works, but this will give you more headroom if comparing to other zip codes.

                     

                    The previous examples I was using were returning weird results and it really had to do with how Lat/Long was being used. There really needs to be an anchor Lat/Lon in the Distance calc in order for it to work properly, where Anchor Latitude or Anchor Longitude are separate calculations: 

                     

                    Distance = 3959 * ACOS

                    (

                    SIN(RADIANS([Anchor Latitude]))* SIN(RADIANS(AVG([Latitude]))) +

                    COS(RADIANS([Anchor Latitude]))* COS(RADIANS(AVG([Latitude]))) *

                    COS(RADIANS(AVG([Longitude])) — RADIANS([Anchor Longitude]))

                    )

                     

                    The newly attached 2018.2 workbook hits the mark and uses an approach found from Data Distilled (https://medium.com/data-distilled/easy-radius-maps-in-tableau-a13b6f17471f)) :

                     

                    Screen Shot 2019-09-12 at 4.52.50 PM.png

                    Screen Shot 2019-09-12 at 4.53.39 PM.png

                    • 22. Re: Maps - Mileage
                      Michael Kaminski

                      Hi Don,

                       

                      Just got your message.  (I am in the eastern zone.)  I need to get some other things done, which shouldn’t take too long.  Then I will start looking ay the mapping techniques that you sent me.  Thanks for all your help.  I really appreciate it.  I’ll probably be reaching out with some more questions as I get into analyzing the workbooks that you sent me.  Thanks again for everything.

                      • 23. Re: Maps - Mileage
                        Michael Kaminski

                        Ho Don,

                         

                        I created a map, in the same fashion as you described.  It worked perfectly!!!

                         

                        That article was a great read.  In the article it gives a link for you to download a csv file with every zip in the USA.  Pretty awesome.  Since we have offices and business in other states, I went ahead and expanded my map.  It works and looks great, just like the workbook you attached but with more zip codes.  I even went ahead and added an extra sheet containing employee info that I inserted into the tool tips for the zip code map.

                         

                        By the way….my boss wants me to take the second level Tableau certification soon.  I worry about that.  Any recommendations or notes, or readings, or practice questions/exams? Or other help?  Something to ease my mind?

                         

                        Thanks again for all the help. Your advice was great.   -Mike

                        • 24. Re: Maps - Mileage
                          Don Wise

                          Hi Michael,

                          Glad that worked out for you! I didn't give you all the zip codes as I wasn't sure just how far out you'd be looking, but wanted to work with a smaller set for example purposes. 

                           

                          So yes, on certification there are 3 levels for Desktop/Creator: (1) Specialist (2) Certified Associate (3) Certified Professional.  So I'm assuming you'd be looking at Certified Associate? If so, some information on the exam itself can be found here: Desktop Certified Associate | Tableau Software .  Recommended courses are Desktop I Fundamentals and Desktop II Intermediate.  The core issues that we see on the forums is to ensure that you have a good internet connection when taking the exam as there is generally no makeup nor refund. So you'll want to make sure you check your network and machine settings in advance: Exam Setup Guide .  The actual exam prep guide can be found here: Desktop Certified Associate Exam Prep Guide .  It's a pretty good outline of what will be covered or what type of questions and examples will be tested during the exam.

                           

                          Hope that helps!  If you would, please close the thread by marking a response as correct?  Best, Don

                          1 2 Previous Next