{"id":3456,"date":"2023-04-12T15:33:17","date_gmt":"2023-04-12T15:33:17","guid":{"rendered":"https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/"},"modified":"2026-01-21T16:26:53","modified_gmt":"2026-01-21T16:26:53","slug":"using-dynamic-server-references-in-pafe-workbooks","status":"publish","type":"post","link":"https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/","title":{"rendered":"How do you use dynamic server references in PAfE workbooks?"},"content":{"rendered":"<p>In this article we look into creating a dynamic server reference with PAFE workbooks so that they can be successfully opened across multiple instances. Read on to learn why we do this, how to set it up, best practices, and some troubleshooting tips.<\/p>\n<h2>What is a Dynamic Server Reference?<\/h2>\n<p>Planning Analytics for Excel worksheet functions require a reference to a Planning Analytics sever. This allows the functions to properly communicate with the user\u2019s intended server when there are multiple servers present. In practice, we can make the server reference dynamic to represent the server you are signed in to. This allows for seamless deployment of development work done on a development server, to production use on a production server.<\/p>\n<h2>Why use a Dynamic Server Reference?<\/h2>\n<p>Dynamic server references make it easy to move PAfE workbooks between Planning Analytics servers. This is useful to allow development, testing, and production to exist on three separate Planning Analytics servers.<\/p>\n<h2>How to set up Dynamic Server Reference?<\/h2>\n<p>The dynamic server reference can be set up using the =TM1PRIMARYDBNAME() or =TM1USER() PAfE worksheet functions. Note that =TM1PRIMARYDBNAME() is not backwards compatible to the Perspectives Excel client. These functions are used to determine the server or servers that a user might be logged into. It is best practice to create a separate and hidden tab to perform the dynamic server logic. This allows for it to do its job in the background without the end user needing to know it is there.<\/p>\n<h3>The TM1PRIMARYDBNAME() Function<\/h3>\n<p>The =TM1PRIMARYDBNAME() function returns the primary server the user authenticated through, even if they are logged into multiple servers. There are no arguments for this function. On a separate \u2018Server\u2019 tab we enter =TM1PRIMARYDBNAME() in a cell. We then give the cell a named range name such as \u2018PA_Server\u2019. You can now replace any hardcoded server references in your =SUBNM(), =DBRW(), and other functions with a reference to the named range.<\/p>\n<p>In the screenshot below we have entered =TM1PRIMARYDBNAME() in cell B2 and given cell B2 the named range name \u2018PA_Server\u2019 The function has rendered as \u201824Retail_Dev\u2019, indicating that we are logged into the development environment.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1902 alignnone\" src=\"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2021\/11\/P1-min.jpg\" alt=\"\" width=\"667\" height=\"430\" \/><\/p>\n<p>On our reporting tab we switch our =SUBNM(Server:Dimension) functions to concatenate the dynamic PA_Server named range with a dimension name and our =DBRW(Server:Cube) functions to concatenate the dynamic PA_Server named range with a cube name. As shown in the screenshot below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1903 alignnone\" src=\"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2021\/11\/P2-min.jpg\" alt=\"\" width=\"780\" height=\"522\" \/><\/p>\n<p>The workbook is now setup to dynamically function using the =TM1PRIMARYDBNAME() function to find the PA environment that the user is logged in to.<\/p>\n<h3>The TM1USER() Function<\/h3>\n<p>The =TM1USER() function requires a server name as an argument and returns the user\u2019s ID if the user is logged into that environment. This function is useful because it can identify multiple environments that a user is logged in to. Additionally, this function works in both PAfE and in the legacy Perspectives Excel clients.<\/p>\n<p>In the screenshot below we have populated column A with the Dev, Test, and Prod server names. Column C has been populated with the =TM1USER() function referencing each row\u2019s server name from column A. Since we are logged into Dev and Test, our user ID is populated for both servers in column C. Since we are not logged into Prod, the function returns nothing.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1904 alignnone\" src=\"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2021\/11\/P3-min.jpg\" alt=\"\" width=\"904\" height=\"559\" \/><\/p>\n<p>In this example we have moved our \u2018PA_Server\u2019 named range to cell B6 and given it some tiered logic. Nested IF() statement logic is used to force the lowest environment available to win out over any higher environments. In our example the \u2018PA_Server\u2019 named range shows as 24Retail_Dev, even though we are logged into both Dev and Test. This is a best practice in order to prevent any accidental development or testing to occur in production. If a user were to be logged into all three at once, the nested IF() logic first checks if you are logged into the Dev environment, then Test, and then Prod. If you are not logged in anywhere it will display that you are not logged in.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1905 alignnone\" src=\"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2021\/11\/P4-min.jpg\" alt=\"\" width=\"904\" height=\"563\" \/><\/p>\n<p>On our reporting tab we switch our =SUBNM(Server:Dimension) functions to concatenate the dynamic PA_Server named range with a dimension name and our =DBRW(Server:Cube) functions to concatenate the dynamic PA_Server named range with a cube name. As shown in the screenshot below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1906 alignnone\" src=\"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2021\/11\/P5-min.jpg\" alt=\"\" width=\"780\" height=\"522\" \/><\/p>\n<p>The workbook is now setup to dynamically choose the PA server based on the =TM1USER() function and the tiered list of server importance.<\/p>\n<p>Bonus Best Practice<\/p>\n<p>It is best practice to hide the Server worksheet from the end users so that it can function in the background. The hidden Server tab can additionally be used to track and modifications to the report for future reference.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1907 alignnone\" src=\"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2021\/11\/P6-min.jpg\" alt=\"\" width=\"904\" height=\"844\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article we look into creating a dynamic server reference with PAFE workbooks so that they can be successfully opened across multiple instances. Read on to learn why we do this, how to set it up, best practices, and some troubleshooting tips. What is a Dynamic Server Reference? Planning Analytics for Excel worksheet functions&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[24],"tags":[38,36,51],"class_list":["post-3456","post","type-post","status-publish","format-standard","hentry","category-ibm","tag-how-tos","tag-planning-analytics","tag-planning-analytics-how-tos"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How do you use dynamic server references in PAfE workbooks? - QueBIT<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How do you use dynamic server references in PAfE workbooks? - QueBIT\" \/>\n<meta property=\"og:description\" content=\"In this article we look into creating a dynamic server reference with PAFE workbooks so that they can be successfully opened across multiple instances. Read on to learn why we do this, how to set it up, best practices, and some troubleshooting tips. What is a Dynamic Server Reference? Planning Analytics for Excel worksheet functions&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/\" \/>\n<meta property=\"og:site_name\" content=\"QueBIT\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-12T15:33:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-21T16:26:53+00:00\" \/>\n<meta name=\"author\" content=\"agoddard\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"agoddard\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-dynamic-server-references-in-pafe-workbooks\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-dynamic-server-references-in-pafe-workbooks\\\/\"},\"author\":{\"name\":\"agoddard\",\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/#\\\/schema\\\/person\\\/e52d72da0fd2f5f70d189343fe4f5084\"},\"headline\":\"How do you use dynamic server references in PAfE workbooks?\",\"datePublished\":\"2023-04-12T15:33:17+00:00\",\"dateModified\":\"2026-01-21T16:26:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-dynamic-server-references-in-pafe-workbooks\\\/\"},\"wordCount\":813,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-dynamic-server-references-in-pafe-workbooks\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/P1-min.jpg\",\"keywords\":[\"How To\u2019s\",\"Planning Analytics\",\"Planning Analytics How To's\"],\"articleSection\":[\"IBM\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-dynamic-server-references-in-pafe-workbooks\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-dynamic-server-references-in-pafe-workbooks\\\/\",\"url\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-dynamic-server-references-in-pafe-workbooks\\\/\",\"name\":\"How do you use dynamic server references in PAfE workbooks? - QueBIT\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-dynamic-server-references-in-pafe-workbooks\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-dynamic-server-references-in-pafe-workbooks\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/P1-min.jpg\",\"datePublished\":\"2023-04-12T15:33:17+00:00\",\"dateModified\":\"2026-01-21T16:26:53+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/#\\\/schema\\\/person\\\/e52d72da0fd2f5f70d189343fe4f5084\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-dynamic-server-references-in-pafe-workbooks\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-dynamic-server-references-in-pafe-workbooks\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-dynamic-server-references-in-pafe-workbooks\\\/#primaryimage\",\"url\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/P1-min.jpg\",\"contentUrl\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/P1-min.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-dynamic-server-references-in-pafe-workbooks\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How do you use dynamic server references in PAfE workbooks?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/#website\",\"url\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/\",\"name\":\"QueBIT\",\"description\":\"QueBIT\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/#\\\/schema\\\/person\\\/e52d72da0fd2f5f70d189343fe4f5084\",\"name\":\"agoddard\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d817b364cff1d66116debde8d1c85e5e76eeece9c5ae731b19276a6040231455?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d817b364cff1d66116debde8d1c85e5e76eeece9c5ae731b19276a6040231455?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d817b364cff1d66116debde8d1c85e5e76eeece9c5ae731b19276a6040231455?s=96&d=mm&r=g\",\"caption\":\"agoddard\"},\"sameAs\":[\"https:\\\/\\\/quebit.com\\\/askquebit\"],\"url\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/author\\\/agoddard\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How do you use dynamic server references in PAfE workbooks? - QueBIT","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/","og_locale":"en_US","og_type":"article","og_title":"How do you use dynamic server references in PAfE workbooks? - QueBIT","og_description":"In this article we look into creating a dynamic server reference with PAFE workbooks so that they can be successfully opened across multiple instances. Read on to learn why we do this, how to set it up, best practices, and some troubleshooting tips. What is a Dynamic Server Reference? Planning Analytics for Excel worksheet functions&hellip;","og_url":"https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/","og_site_name":"QueBIT","article_published_time":"2023-04-12T15:33:17+00:00","article_modified_time":"2026-01-21T16:26:53+00:00","author":"agoddard","twitter_card":"summary_large_image","twitter_misc":{"Written by":"agoddard","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/#article","isPartOf":{"@id":"https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/"},"author":{"name":"agoddard","@id":"https:\/\/quebit.com\/askquebit\/#\/schema\/person\/e52d72da0fd2f5f70d189343fe4f5084"},"headline":"How do you use dynamic server references in PAfE workbooks?","datePublished":"2023-04-12T15:33:17+00:00","dateModified":"2026-01-21T16:26:53+00:00","mainEntityOfPage":{"@id":"https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/"},"wordCount":813,"commentCount":0,"image":{"@id":"https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/#primaryimage"},"thumbnailUrl":"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2021\/11\/P1-min.jpg","keywords":["How To\u2019s","Planning Analytics","Planning Analytics How To's"],"articleSection":["IBM"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/","url":"https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/","name":"How do you use dynamic server references in PAfE workbooks? - QueBIT","isPartOf":{"@id":"https:\/\/quebit.com\/askquebit\/#website"},"primaryImageOfPage":{"@id":"https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/#primaryimage"},"image":{"@id":"https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/#primaryimage"},"thumbnailUrl":"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2021\/11\/P1-min.jpg","datePublished":"2023-04-12T15:33:17+00:00","dateModified":"2026-01-21T16:26:53+00:00","author":{"@id":"https:\/\/quebit.com\/askquebit\/#\/schema\/person\/e52d72da0fd2f5f70d189343fe4f5084"},"breadcrumb":{"@id":"https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/#primaryimage","url":"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2021\/11\/P1-min.jpg","contentUrl":"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2021\/11\/P1-min.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/quebit.com\/askquebit\/using-dynamic-server-references-in-pafe-workbooks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/quebit.com\/askquebit\/"},{"@type":"ListItem","position":2,"name":"How do you use dynamic server references in PAfE workbooks?"}]},{"@type":"WebSite","@id":"https:\/\/quebit.com\/askquebit\/#website","url":"https:\/\/quebit.com\/askquebit\/","name":"QueBIT","description":"QueBIT","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/quebit.com\/askquebit\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/quebit.com\/askquebit\/#\/schema\/person\/e52d72da0fd2f5f70d189343fe4f5084","name":"agoddard","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d817b364cff1d66116debde8d1c85e5e76eeece9c5ae731b19276a6040231455?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d817b364cff1d66116debde8d1c85e5e76eeece9c5ae731b19276a6040231455?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d817b364cff1d66116debde8d1c85e5e76eeece9c5ae731b19276a6040231455?s=96&d=mm&r=g","caption":"agoddard"},"sameAs":["https:\/\/quebit.com\/askquebit"],"url":"https:\/\/quebit.com\/askquebit\/author\/agoddard\/"}]}},"_links":{"self":[{"href":"https:\/\/quebit.com\/askquebit\/wp-json\/wp\/v2\/posts\/3456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/quebit.com\/askquebit\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/quebit.com\/askquebit\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/quebit.com\/askquebit\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/quebit.com\/askquebit\/wp-json\/wp\/v2\/comments?post=3456"}],"version-history":[{"count":2,"href":"https:\/\/quebit.com\/askquebit\/wp-json\/wp\/v2\/posts\/3456\/revisions"}],"predecessor-version":[{"id":5111,"href":"https:\/\/quebit.com\/askquebit\/wp-json\/wp\/v2\/posts\/3456\/revisions\/5111"}],"wp:attachment":[{"href":"https:\/\/quebit.com\/askquebit\/wp-json\/wp\/v2\/media?parent=3456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/quebit.com\/askquebit\/wp-json\/wp\/v2\/categories?post=3456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/quebit.com\/askquebit\/wp-json\/wp\/v2\/tags?post=3456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}