{"id":5820,"date":"2022-02-09T22:32:51","date_gmt":"2022-02-09T22:32:51","guid":{"rendered":"http:\/\/forquestsolutions.com\/?p=5820"},"modified":"2026-03-18T18:05:10","modified_gmt":"2026-03-18T18:05:10","slug":"distance-calculation","status":"publish","type":"post","link":"https:\/\/forquestsolutions.com\/staging\/7345\/distance-calculation\/","title":{"rendered":"Planning Analytics Distance Calculation"},"content":{"rendered":"<h1>Straight-Line Distance Calculation<\/h1>\n<p>Straight-line distance otherwise known as how the crow flies is the simplest way of measuring distance between two destinations. However, this distance can be calculated using different formulas based on a variety of assumptions.<strong><br \/><\/strong><\/p>\n<p><strong>Pythagorean Theorem:<\/strong><br \/>Distance = SQRT((X2 &#8211; X1)^2 + (Y2 &#8211; Y1)^2)<br \/>Where X1, Y1 and X2, Y2 are the Cartesian coordinates of your destinations.<\/p>\n<p>You can only use this equation when your coordinates are projected geographical coordinates and the distance between the two destinations is less than 12 miles (20 kilometers).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" loading=\"lazy\" src=\"https:\/\/forquestsolutions.com\/staging\/7345\/wp-content\/uploads\/2022\/02\/Distance-Calculator-1024x648.webp\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" srcset=\"https:\/\/i0.wp.com\/h3d.73b.myftpupload.com\/wp-content\/uploads\/2022\/02\/Distance-Calculator.png?resize=1024%2C648 1024w, https:\/\/i0.wp.com\/h3d.73b.myftpupload.com\/wp-content\/uploads\/2022\/02\/Distance-Calculator.png?resize=300%2C190 300w, https:\/\/i0.wp.com\/h3d.73b.myftpupload.com\/wp-content\/uploads\/2022\/02\/Distance-Calculator.png?resize=768%2C486 768w, https:\/\/i0.wp.com\/h3d.73b.myftpupload.com\/wp-content\/uploads\/2022\/02\/Distance-Calculator.png?w=1148 1148w\" alt=\"IBM Planning Analytics Zip Distance Calculator\" width=\"1024\" height=\"648\" \/><br \/><img loading=\"lazy\" decoding=\"async\" loading=\"lazy\" src=\"https:\/\/forquestsolutions.com\/staging\/7345\/wp-content\/uploads\/2022\/02\/Sales-Planning-Tool-Map-1024x535.png\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" srcset=\"https:\/\/i0.wp.com\/h3d.73b.myftpupload.com\/wp-content\/uploads\/2022\/02\/Sales-Planning-Tool-Map.png?resize=1024%2C535 1024w, https:\/\/i0.wp.com\/h3d.73b.myftpupload.com\/wp-content\/uploads\/2022\/02\/Sales-Planning-Tool-Map.png?resize=300%2C157 300w, https:\/\/i0.wp.com\/h3d.73b.myftpupload.com\/wp-content\/uploads\/2022\/02\/Sales-Planning-Tool-Map.png?resize=768%2C401 768w, https:\/\/i0.wp.com\/h3d.73b.myftpupload.com\/wp-content\/uploads\/2022\/02\/Sales-Planning-Tool-Map.png?resize=1536%2C803 1536w, https:\/\/i0.wp.com\/h3d.73b.myftpupload.com\/wp-content\/uploads\/2022\/02\/Sales-Planning-Tool-Map.png?resize=2048%2C1070 2048w, https:\/\/i0.wp.com\/h3d.73b.myftpupload.com\/wp-content\/uploads\/2022\/02\/Sales-Planning-Tool-Map.png?w=2400 2400w\" alt=\"IBM Planning Analytics Map\" width=\"1024\" height=\"535\" \/><\/p>\n<ol>\n<li>Below are the steps to create a zip to zip calculator in IBM Planning Analytics.<\/li>\n<\/ol>\n<p>Step 1: Create 2 dimensions in Planning Analytics (From Zip and To Zip)<\/p>\n<p>Step 2: Create latitude and longitude numeric attributes on both dimensions.<\/p>\n<p>Step 3: Populate the US zip code elements in both dimensions<\/p>\n<p>Step 4: Populate the latitude and longitude attributes on both dimensions.<\/p>\n<p>Step 5:\u00a0 Create a Measure dimension for your cube and call it &#8220;Distance Measure&#8221;<\/p>\n<p>Step 6:\u00a0 Create a cube called Distance<\/p>\n<p>Step 7: Create a cube business rule on the Distance cube<\/p>\n<p>Step 8:\u00a0 Add the following rules to the cube and save the rule<\/p>\n<ul>\n<li>[&#8216;Miles&#8217;] = N: SQRT((69*(ATTRN(&#8216;FromZip&#8217;,!FromZip,&#8217;Latitude&#8217;) &#8211; ATTRN(&#8216;ToZip&#8217;,!ToZip,&#8217;Latitude&#8217;)))^2 + (53*(ATTRN(&#8216;FromZip&#8217;,!FromZip,&#8217;Longitude&#8217;)-ATTRN(&#8216;ToZip&#8217;,!ToZip,&#8217;Longitude&#8217;)))^2);<\/li>\n<\/ul>\n<ul>\n<li>[&#8216;Kilometers&#8217;] = N: [&#8216;Miles&#8217;] * 1.60934;<\/li>\n<\/ul>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Straight-Line Distance Calculation<\/p>\n","protected":false},"author":16,"featured_media":5821,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[27],"tags":[71,70],"class_list":["post-5820","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-planning-analytics","tag-calculations","tag-distance"],"_links":{"self":[{"href":"https:\/\/forquestsolutions.com\/staging\/7345\/wp-json\/wp\/v2\/posts\/5820","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/forquestsolutions.com\/staging\/7345\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/forquestsolutions.com\/staging\/7345\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/forquestsolutions.com\/staging\/7345\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/forquestsolutions.com\/staging\/7345\/wp-json\/wp\/v2\/comments?post=5820"}],"version-history":[{"count":8,"href":"https:\/\/forquestsolutions.com\/staging\/7345\/wp-json\/wp\/v2\/posts\/5820\/revisions"}],"predecessor-version":[{"id":9468,"href":"https:\/\/forquestsolutions.com\/staging\/7345\/wp-json\/wp\/v2\/posts\/5820\/revisions\/9468"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/forquestsolutions.com\/staging\/7345\/wp-json\/wp\/v2\/media\/5821"}],"wp:attachment":[{"href":"https:\/\/forquestsolutions.com\/staging\/7345\/wp-json\/wp\/v2\/media?parent=5820"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/forquestsolutions.com\/staging\/7345\/wp-json\/wp\/v2\/categories?post=5820"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/forquestsolutions.com\/staging\/7345\/wp-json\/wp\/v2\/tags?post=5820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}