{"id":3479,"date":"2023-04-12T15:33:22","date_gmt":"2023-04-12T15:33:22","guid":{"rendered":"https:\/\/quebit.com\/askquebit\/using-mdx-to-create-a-dynamic-cube-view\/"},"modified":"2026-01-20T16:32:40","modified_gmt":"2026-01-20T16:32:40","slug":"using-mdx-to-create-a-dynamic-cube-view","status":"publish","type":"post","link":"https:\/\/quebit.com\/askquebit\/using-mdx-to-create-a-dynamic-cube-view\/","title":{"rendered":"How Do I Use MDX to Create a Dynamic Cube View in IBM Planning Analytics?"},"content":{"rendered":"<p>IBM Planning Analytics (PA) subsets can be made dynamic by using multi-dimensional expressions (MDX). Doing so allows for automation and will ensure that subsets update if the dimension changes. \u00a0MDX allows for many different use cases such as filtering by attributes, levels or using a wildcard search to display all elements that meet a specific naming pattern.<\/p>\n<p>For example, below is a cube view that references a dynamic subset of periods that changes based on the version selected in the view. When the Version element selected is \u201cDraft\u201d, 2022 periods are shown because the \u201cYear\u201d attribute for \u201cDraft\u201d is populated to \u201c2022\u201d. The MDX statement on the Periods dimension will look to equal the string value of the \u201cYear\u201d attribute for the version element selected. When a user changes the Version element to \u201cBudget\u201d, periods from 2023 appear.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2356 alignnone\" src=\"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2022\/06\/CUBE1-min.jpg\" alt=\"\" width=\"869\" height=\"404\" \/><\/p>\n<p>To link the two dimensions of Versions and Periods in this view, an attribute was created on the Versions dimension called \u201cYear\u201d. Each version has an associated year such as Draft being 2022, Budget being 2023 etc.:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2351 alignnone\" src=\"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2022\/06\/CUBE2-min.jpg\" alt=\"\" width=\"548\" height=\"140\" \/><\/p>\n<p>In the Periods dimension, we have a rollup of \u201cAll Time\u201d that\u2019s the parent of all years. The leaf elements are months that roll up to quarters which rollup to years. The first screenshot here shows the elements of \u201c2022\u201d without the alias on to give insight into the Periods dimension structure.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2352 alignnone\" src=\"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2022\/06\/CUBE3-min.jpg\" alt=\"\" width=\"187\" height=\"220\" \/><\/p>\n<p>With the alias on, the 3 leaf elements appear like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2353 alignnone\" src=\"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2022\/06\/CUBE4-min.jpg\" alt=\"\" width=\"192\" height=\"223\" \/><\/p>\n<p>The below MDX tell us to filter the periods dimension for where the current member selected from the Periods dimension is equal to the \u201cYear\u201d attribute of the current member selected from the Version dimension. Please note, the \u201c.CURRENTMEMBER\u201d function is only useful in a subset used to manipulate a cube view because it depends on an element within the cube view to be populated. The MDX below would only return one element, being the year. For example, if \u201cDraft\u201d were chosen in our cube view, we\u2019d see the element \u201c2022\u201d.\u00a0 But if we change our Version dimension selection to \u201cBudget\u201d, our period would update to \u201c2023\u201d.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2354 alignnone\" src=\"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2022\/06\/CUBE5-min.jpg\" alt=\"\" width=\"489\" height=\"79\" \/><\/p>\n<p>To further develop the MDX, we can wrap a TM1DRILLDOWNMEMBER function around the above statement to expand the \u201c2022\u201d element. When developing MDX, we do a lot of \u201cwrapping\u201d to add complexity because we are nesting set expressions within functions to return new set expressions. Therefore, it\u2019s often helpful to read MDX from the inside out, to see the layers of added expressions. With the TM1DRILLDOWNMEMBER function in place, we now have the year, quarters, and months of \u201c2022\u201d. Wrapping a FILTERBYLEVEL ( &lt;&lt;subset&gt;&gt;, 0) around the subset returned by this MDX expression will return only the leaf-level elements, which are the months of \u201c2022\u201d.<\/p>\n<p>Lastly, we add a comma after the expression that returns our month and the entire above expression to give us the year. We can use commas in between each final MDX expression to return both expressions\u2019 products within the same subset. Our final dynamic subset is the 12 months of a given year followed by the year itself.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2355 alignnone\" src=\"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2022\/06\/CUBE6-min.jpg\" alt=\"\" width=\"579\" height=\"119\" \/><\/p>\n<p>We now have a cube view that automatically changes periods based on version selected. This trick can be powerful to develop a user-friendly User Interface (UI). From a user standpoint, this will save extra clicks and adjustments of the cube view but still allows the user the ability to adjust the periods dimension without depending on version if needed. Also, the dynamically changing cube view can help create a more robust UI in general. Now, instead of having separate UIs for Draft and Budget planning, we can utilize one UI which is ideal for maintenance and management.<\/p>\n<p><strong>Interested in Learning More?<\/strong><\/p>\n<p>Are you interested in finding out more about how to use MDX in Planning Analytics? Then <a href=\"https:\/\/quebit.com\/who-we-are\/contact-us\/\">Contact QueBIT<\/a> today and we\u2019ll be happy to introduce you to the language itself and its clever abilities!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>IBM Planning Analytics (PA) subsets can be made dynamic by using multi-dimensional expressions (MDX). Doing so allows for automation and will ensure that subsets update if the dimension changes. \u00a0MDX allows for many different use cases such as filtering by attributes, levels or using a wildcard search to display all elements that meet a specific&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-3479","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 I Use MDX to Create a Dynamic Cube View in IBM Planning Analytics? - 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-mdx-to-create-a-dynamic-cube-view\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How Do I Use MDX to Create a Dynamic Cube View in IBM Planning Analytics? - QueBIT\" \/>\n<meta property=\"og:description\" content=\"IBM Planning Analytics (PA) subsets can be made dynamic by using multi-dimensional expressions (MDX). Doing so allows for automation and will ensure that subsets update if the dimension changes. \u00a0MDX allows for many different use cases such as filtering by attributes, levels or using a wildcard search to display all elements that meet a specific&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/quebit.com\/askquebit\/using-mdx-to-create-a-dynamic-cube-view\/\" \/>\n<meta property=\"og:site_name\" content=\"QueBIT\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-12T15:33:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-20T16:32:40+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-mdx-to-create-a-dynamic-cube-view\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-mdx-to-create-a-dynamic-cube-view\\\/\"},\"author\":{\"name\":\"agoddard\",\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/#\\\/schema\\\/person\\\/e52d72da0fd2f5f70d189343fe4f5084\"},\"headline\":\"How Do I Use MDX to Create a Dynamic Cube View in IBM Planning Analytics?\",\"datePublished\":\"2023-04-12T15:33:22+00:00\",\"dateModified\":\"2026-01-20T16:32:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-mdx-to-create-a-dynamic-cube-view\\\/\"},\"wordCount\":653,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-mdx-to-create-a-dynamic-cube-view\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/CUBE1-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-mdx-to-create-a-dynamic-cube-view\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-mdx-to-create-a-dynamic-cube-view\\\/\",\"url\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-mdx-to-create-a-dynamic-cube-view\\\/\",\"name\":\"How Do I Use MDX to Create a Dynamic Cube View in IBM Planning Analytics? - QueBIT\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-mdx-to-create-a-dynamic-cube-view\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-mdx-to-create-a-dynamic-cube-view\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/CUBE1-min.jpg\",\"datePublished\":\"2023-04-12T15:33:22+00:00\",\"dateModified\":\"2026-01-20T16:32:40+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/#\\\/schema\\\/person\\\/e52d72da0fd2f5f70d189343fe4f5084\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-mdx-to-create-a-dynamic-cube-view\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-mdx-to-create-a-dynamic-cube-view\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-mdx-to-create-a-dynamic-cube-view\\\/#primaryimage\",\"url\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/CUBE1-min.jpg\",\"contentUrl\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/CUBE1-min.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/using-mdx-to-create-a-dynamic-cube-view\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/quebit.com\\\/askquebit\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How Do I Use MDX to Create a Dynamic Cube View in IBM Planning Analytics?\"}]},{\"@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 I Use MDX to Create a Dynamic Cube View in IBM Planning Analytics? - 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-mdx-to-create-a-dynamic-cube-view\/","og_locale":"en_US","og_type":"article","og_title":"How Do I Use MDX to Create a Dynamic Cube View in IBM Planning Analytics? - QueBIT","og_description":"IBM Planning Analytics (PA) subsets can be made dynamic by using multi-dimensional expressions (MDX). Doing so allows for automation and will ensure that subsets update if the dimension changes. \u00a0MDX allows for many different use cases such as filtering by attributes, levels or using a wildcard search to display all elements that meet a specific&hellip;","og_url":"https:\/\/quebit.com\/askquebit\/using-mdx-to-create-a-dynamic-cube-view\/","og_site_name":"QueBIT","article_published_time":"2023-04-12T15:33:22+00:00","article_modified_time":"2026-01-20T16:32:40+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-mdx-to-create-a-dynamic-cube-view\/#article","isPartOf":{"@id":"https:\/\/quebit.com\/askquebit\/using-mdx-to-create-a-dynamic-cube-view\/"},"author":{"name":"agoddard","@id":"https:\/\/quebit.com\/askquebit\/#\/schema\/person\/e52d72da0fd2f5f70d189343fe4f5084"},"headline":"How Do I Use MDX to Create a Dynamic Cube View in IBM Planning Analytics?","datePublished":"2023-04-12T15:33:22+00:00","dateModified":"2026-01-20T16:32:40+00:00","mainEntityOfPage":{"@id":"https:\/\/quebit.com\/askquebit\/using-mdx-to-create-a-dynamic-cube-view\/"},"wordCount":653,"commentCount":0,"image":{"@id":"https:\/\/quebit.com\/askquebit\/using-mdx-to-create-a-dynamic-cube-view\/#primaryimage"},"thumbnailUrl":"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2022\/06\/CUBE1-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-mdx-to-create-a-dynamic-cube-view\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/quebit.com\/askquebit\/using-mdx-to-create-a-dynamic-cube-view\/","url":"https:\/\/quebit.com\/askquebit\/using-mdx-to-create-a-dynamic-cube-view\/","name":"How Do I Use MDX to Create a Dynamic Cube View in IBM Planning Analytics? - QueBIT","isPartOf":{"@id":"https:\/\/quebit.com\/askquebit\/#website"},"primaryImageOfPage":{"@id":"https:\/\/quebit.com\/askquebit\/using-mdx-to-create-a-dynamic-cube-view\/#primaryimage"},"image":{"@id":"https:\/\/quebit.com\/askquebit\/using-mdx-to-create-a-dynamic-cube-view\/#primaryimage"},"thumbnailUrl":"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2022\/06\/CUBE1-min.jpg","datePublished":"2023-04-12T15:33:22+00:00","dateModified":"2026-01-20T16:32:40+00:00","author":{"@id":"https:\/\/quebit.com\/askquebit\/#\/schema\/person\/e52d72da0fd2f5f70d189343fe4f5084"},"breadcrumb":{"@id":"https:\/\/quebit.com\/askquebit\/using-mdx-to-create-a-dynamic-cube-view\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/quebit.com\/askquebit\/using-mdx-to-create-a-dynamic-cube-view\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/quebit.com\/askquebit\/using-mdx-to-create-a-dynamic-cube-view\/#primaryimage","url":"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2022\/06\/CUBE1-min.jpg","contentUrl":"https:\/\/quebit.com\/askquebit\/wp-content\/uploads\/2022\/06\/CUBE1-min.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/quebit.com\/askquebit\/using-mdx-to-create-a-dynamic-cube-view\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/quebit.com\/askquebit\/"},{"@type":"ListItem","position":2,"name":"How Do I Use MDX to Create a Dynamic Cube View in IBM Planning Analytics?"}]},{"@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\/3479","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=3479"}],"version-history":[{"count":2,"href":"https:\/\/quebit.com\/askquebit\/wp-json\/wp\/v2\/posts\/3479\/revisions"}],"predecessor-version":[{"id":5103,"href":"https:\/\/quebit.com\/askquebit\/wp-json\/wp\/v2\/posts\/3479\/revisions\/5103"}],"wp:attachment":[{"href":"https:\/\/quebit.com\/askquebit\/wp-json\/wp\/v2\/media?parent=3479"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/quebit.com\/askquebit\/wp-json\/wp\/v2\/categories?post=3479"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/quebit.com\/askquebit\/wp-json\/wp\/v2\/tags?post=3479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}