{"id":14547,"date":"2014-06-16T12:25:11","date_gmt":"2014-06-16T10:25:11","guid":{"rendered":"http:\/\/infozone.se\/?p=14547"},"modified":"2014-06-16T12:25:11","modified_gmt":"2014-06-16T10:25:11","slug":"parameter-in-variables","status":"publish","type":"post","link":"https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/","title":{"rendered":"Parameter in variables"},"content":{"rendered":"

Parameter passing to variables is a very useful capability but unfortunately not very common.<\/p>\n

What you do is that you create a place holder for one or several parameters in your variable and when you call the variable you also pass parameter values.<\/p>\n

Let’s go on with an example.<\/p>\n

Assume we have an application where we want to see the Actuals for external customers in some places and internal customers on others. Does one work with variables we may find variables looking like this<\/p>\n

eActualsCustomerExternal = sum({<CustomerType={'External'}>}Actual)\n\neActualsCustomerInternal= sum({<CustomerType={'Internal'}>}Actual)\n\neActuals = sum(Actual)<\/pre>\n

However with the help of parameter passing in variables we can concatenate these two to variable to a single one<\/p>\n

eActuals = sum({<CustomerType={'$1'}>} Actual)<\/pre>\n

In the expression above we have the $1 which is a holder for a parameter to be passed when the variable is being called.<\/p>\n

When calling the variable we write<\/p>\n

eActuals(External)<\/pre>\n

And thus ‘External’ is the paramater replacing the $1 in the variable expression.<\/p>\n

Passing more parameters can be done by separating the parameters with a comma<\/p>\n

eActuals(External, CustomerType)<\/pre>\n

 <\/p>\n

But remember to create a placeholder for each parameter<\/p>\n

eActuals = sum({<$2={'$1'}>} Actual)<\/pre>\n","protected":false},"excerpt":{"rendered":"

Parameter passing to variables is a very useful capability but unfortunately not very common. What you do is that you create a place holder for one or several parameters in your variable and when you call the variable you also pass parameter values. Let’s go on with an example. Assume we have an application where […]<\/p>\n","protected":false},"author":2,"featured_media":21360,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[118],"tags":[],"class_list":["post-14547","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"yoast_head":"\nParameter in variables - Infozone - English<\/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:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Parameter in variables - Infozone - English\" \/>\n<meta property=\"og:description\" content=\"Parameter passing to variables is a very useful capability but unfortunately not very common. What you do is that you create a place holder for one or several parameters in your variable and when you call the variable you also pass parameter values. Let’s go on with an example. Assume we have an application where […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/\" \/>\n<meta property=\"og:site_name\" content=\"Infozone - English\" \/>\n<meta property=\"article:published_time\" content=\"2014-06-16T10:25:11+00:00\" \/>\n<meta name=\"author\" content=\"Eva-Katrine\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Eva-Katrine\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/\",\"url\":\"https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/\",\"name\":\"Parameter in variables - Infozone - English\",\"isPartOf\":{\"@id\":\"https:\/\/www.infozone.se\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/#primaryimage\"},\"thumbnailUrl\":\"\",\"datePublished\":\"2014-06-16T10:25:11+00:00\",\"author\":{\"@id\":\"https:\/\/www.infozone.se\/en\/#\/schema\/person\/0d207ef1167f0800247368907c22564a\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/#primaryimage\",\"url\":\"\",\"contentUrl\":\"\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Hem\",\"item\":\"https:\/\/www.infozone.se\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Parameter in variables\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.infozone.se\/en\/#website\",\"url\":\"https:\/\/www.infozone.se\/en\/\",\"name\":\"Infozone - English\",\"description\":\"We Create Heroes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.infozone.se\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.infozone.se\/en\/#\/schema\/person\/0d207ef1167f0800247368907c22564a\",\"name\":\"Eva-Katrine\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.infozone.se\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/20706a650402f90b216ccbbe6a90cfdb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/20706a650402f90b216ccbbe6a90cfdb?s=96&d=mm&r=g\",\"caption\":\"Eva-Katrine\"},\"url\":\"https:\/\/www.infozone.se\/en\/latest-news\/author\/eva-katrine\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Parameter in variables - Infozone - English","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:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/","og_locale":"en_US","og_type":"article","og_title":"Parameter in variables - Infozone - English","og_description":"Parameter passing to variables is a very useful capability but unfortunately not very common. What you do is that you create a place holder for one or several parameters in your variable and when you call the variable you also pass parameter values. Let’s go on with an example. Assume we have an application where […]","og_url":"https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/","og_site_name":"Infozone - English","article_published_time":"2014-06-16T10:25:11+00:00","author":"Eva-Katrine","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Eva-Katrine","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/","url":"https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/","name":"Parameter in variables - Infozone - English","isPartOf":{"@id":"https:\/\/www.infozone.se\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/#primaryimage"},"image":{"@id":"https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/#primaryimage"},"thumbnailUrl":"","datePublished":"2014-06-16T10:25:11+00:00","author":{"@id":"https:\/\/www.infozone.se\/en\/#\/schema\/person\/0d207ef1167f0800247368907c22564a"},"breadcrumb":{"@id":"https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/#primaryimage","url":"","contentUrl":""},{"@type":"BreadcrumbList","@id":"https:\/\/www.infozone.se\/en\/latest-news\/parameter-in-variables\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Hem","item":"https:\/\/www.infozone.se\/en\/"},{"@type":"ListItem","position":2,"name":"Parameter in variables"}]},{"@type":"WebSite","@id":"https:\/\/www.infozone.se\/en\/#website","url":"https:\/\/www.infozone.se\/en\/","name":"Infozone - English","description":"We Create Heroes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.infozone.se\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.infozone.se\/en\/#\/schema\/person\/0d207ef1167f0800247368907c22564a","name":"Eva-Katrine","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infozone.se\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/20706a650402f90b216ccbbe6a90cfdb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/20706a650402f90b216ccbbe6a90cfdb?s=96&d=mm&r=g","caption":"Eva-Katrine"},"url":"https:\/\/www.infozone.se\/en\/latest-news\/author\/eva-katrine\/"}]}},"acf":[],"_links":{"self":[{"href":"https:\/\/www.infozone.se\/en\/wp-json\/wp\/v2\/posts\/14547","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.infozone.se\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.infozone.se\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.infozone.se\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.infozone.se\/en\/wp-json\/wp\/v2\/comments?post=14547"}],"version-history":[{"count":0,"href":"https:\/\/www.infozone.se\/en\/wp-json\/wp\/v2\/posts\/14547\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.infozone.se\/en\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/www.infozone.se\/en\/wp-json\/wp\/v2\/media?parent=14547"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.infozone.se\/en\/wp-json\/wp\/v2\/categories?post=14547"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.infozone.se\/en\/wp-json\/wp\/v2\/tags?post=14547"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}