{"id":110,"date":"2021-01-29T21:17:35","date_gmt":"2021-01-29T21:17:35","guid":{"rendered":"http:\/\/approbato.com\/blog\/?p=110"},"modified":"2022-08-04T18:59:17","modified_gmt":"2022-08-04T18:59:17","slug":"change-colors-in-qlik-using-variables","status":"publish","type":"post","link":"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/","title":{"rendered":"Change colors in Qlik using variables"},"content":{"rendered":"\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n\n\n\n<p class=\"has-vivid-red-color has-text-color\">Hi! <strong>Please tell me what kind of Qlik content you think is relevant or interesting to have in the channel (use the link below). Thanks!<\/strong><\/p>\n\n\n\n<p>Link: <a href=\"https:\/\/approbato.com\/blog\/quick-qlik-survey\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/approbato.com\/blog\/quick-qlik-survey\/<\/a><\/p>\n\n\n\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n\n\n<p>\u00a0<\/p>\n<p>In this video\/post I describe two ways to dynamically change the colors of your visuals in Qlik Sense.<\/p>\n<p><iframe loading=\"lazy\" title=\"Change the colors in Qlik Sense using variables\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/lSYnmjFNffs?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p><a href=\"http:\/\/approbato.com\/files\/Changing%20Colors.qvf\">Click here to download<\/a> the QVF created in the video.<\/p>\n<p>The first one is quite simple:<br \/>Qlik uses the RGB color scheme, so we can color the visuals by expression using the RGB() function. Inside the function it we use the variables to change the colors.<br \/>In the video I create three variables (one for each color &#8211; R for Red, G for Green and B for Blue), and set the values to be between 0 and 255.<br \/>With that we use a slider changing these variables, and in the charts we use the following expression to use the desired color: <strong>RGB ( $(R) , $(G) , $(B) )<\/strong> &#8211; Use the Dollar sign + Parenthesis to call the variables.<\/p>\n\n\n<p>The second way in the video is by using a &#8220;Color table&#8221;, in which we have rgb codes for a rank\/number of options, and we call these codes as texts using variables and set analysis (for instance: <\/p>\n\n\n\n<p>Only( {&lt;Color={&#8216;Red&#8217;},SortColor={&#8216;1&#8217;}&gt;}  ColorCode) .<\/p>\n\n\n\n<p>The Color table used in the example was this one:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>Color<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong>SortColor<\/strong><\/td><td><strong>ColorCode<\/strong><\/td><\/tr><tr><td>Red<\/td><td class=\"has-text-align-center\" data-align=\"center\">1<\/td><td>rgb(243, 207, 204)<\/td><\/tr><tr><td>Red<\/td><td class=\"has-text-align-center\" data-align=\"center\">2<\/td><td>rgb(231, 158, 153)<\/td><\/tr><tr><td>Red<\/td><td class=\"has-text-align-center\" data-align=\"center\">3<\/td><td>rgb(220, 110, 102)<\/td><\/tr><tr><td>Red<\/td><td class=\"has-text-align-center\" data-align=\"center\">4<\/td><td>rgb(208, 61, 51)<\/td><\/tr><tr><td>Red<\/td><td class=\"has-text-align-center\" data-align=\"center\">5<\/td><td>rgb(138, 4, 0)<\/td><\/tr><tr><td>Green<\/td><td class=\"has-text-align-center\" data-align=\"center\">1<\/td><td>rgb(204,244,211)<\/td><\/tr><tr><td>Green<\/td><td class=\"has-text-align-center\" data-align=\"center\">2<\/td><td>rgb(153,233,166)<\/td><\/tr><tr><td>Green<\/td><td class=\"has-text-align-center\" data-align=\"center\">3<\/td><td>rgb(107,197,122)<\/td><\/tr><tr><td>Green<\/td><td class=\"has-text-align-center\" data-align=\"center\">4<\/td><td>rgb(8,158,33)<\/td><\/tr><tr><td>Green<\/td><td class=\"has-text-align-center\" data-align=\"center\">5<\/td><td>rgb(0,125,21)<\/td><\/tr><tr><td>Yellow<\/td><td class=\"has-text-align-center\" data-align=\"center\">1<\/td><td>rgb(245, 236, 204)<\/td><\/tr><tr><td>Yellow<\/td><td class=\"has-text-align-center\" data-align=\"center\">2<\/td><td>rgb(235, 217, 153)<\/td><\/tr><tr><td>Yellow<\/td><td class=\"has-text-align-center\" data-align=\"center\">3<\/td><td>rgb(225, 199, 102)<\/td><\/tr><tr><td>Yellow<\/td><td class=\"has-text-align-center\" data-align=\"center\">4<\/td><td>rgb(215, 180, 51)<\/td><\/tr><tr><td>Yellow<\/td><td class=\"has-text-align-center\" data-align=\"center\">5<\/td><td>rgb(205, 161, 0)<\/td><\/tr><tr><td>Blue&nbsp;<\/td><td class=\"has-text-align-center\" data-align=\"center\">1<\/td><td>&nbsp;rgb(204, 205, 243)<\/td><\/tr><tr><td>Blue&nbsp;<\/td><td class=\"has-text-align-center\" data-align=\"center\">2<\/td><td>&nbsp;rgb(153, 154, 231)<\/td><\/tr><tr><td>Blue&nbsp;<\/td><td class=\"has-text-align-center\" data-align=\"center\">3<\/td><td>&nbsp;rgb(51, 53, 208)<\/td><\/tr><tr><td>Blue&nbsp;<\/td><td class=\"has-text-align-center\" data-align=\"center\">4<\/td><td>&nbsp;rgb(3, 6, 161)<\/td><\/tr><tr><td>Blue&nbsp;<\/td><td class=\"has-text-align-center\" data-align=\"center\">5<\/td><td>&nbsp;rgb(0, 2, 115)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>There are many other ways and possibilities, but I hope you find it useful.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this video\/post I describe two ways to dynamically change the colors of your visuals in Qlik Sense<\/p>\n","protected":false},"author":1,"featured_media":114,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14,2],"tags":[8,9],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.2.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Change colors in Qlik using variables - Guilherme Approbato<\/title>\n<meta name=\"description\" content=\"Let the users change the colors of the charts using variables in Qlik Sense.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Change colors in Qlik using variables - Guilherme Approbato\" \/>\n<meta property=\"og:description\" content=\"Let the users change the colors of the charts using variables in Qlik Sense.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/\" \/>\n<meta property=\"og:site_name\" content=\"Guilherme Approbato\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-29T21:17:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-04T18:59:17+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/approbato.com\/blog\/wp-content\/uploads\/2021\/01\/Thumb_Color_Video.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1884\" \/>\n\t<meta property=\"og:image:height\" content=\"818\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Guilherme Approbato\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Guilherme Approbato\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/\"},\"author\":{\"name\":\"Guilherme Approbato\",\"@id\":\"https:\/\/approbato.com\/blog\/#\/schema\/person\/64f139096656d0884d037457309f9c75\"},\"headline\":\"Change colors in Qlik using variables\",\"datePublished\":\"2021-01-29T21:17:35+00:00\",\"dateModified\":\"2022-08-04T18:59:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/\"},\"wordCount\":299,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/approbato.com\/blog\/#\/schema\/person\/64f139096656d0884d037457309f9c75\"},\"keywords\":[\"Qlik Sense\",\"Variables\"],\"articleSection\":[\"English\",\"Qlik\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/\",\"url\":\"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/\",\"name\":\"Change colors in Qlik using variables - Guilherme Approbato\",\"isPartOf\":{\"@id\":\"https:\/\/approbato.com\/blog\/#website\"},\"datePublished\":\"2021-01-29T21:17:35+00:00\",\"dateModified\":\"2022-08-04T18:59:17+00:00\",\"description\":\"Let the users change the colors of the charts using variables in Qlik Sense.\",\"breadcrumb\":{\"@id\":\"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/approbato.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Change colors in Qlik using variables\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/approbato.com\/blog\/#website\",\"url\":\"https:\/\/approbato.com\/blog\/\",\"name\":\"Guilherme Approbato\",\"description\":\"Management Consulting | Certified Qlik Data Architect and Business Analyst\",\"publisher\":{\"@id\":\"https:\/\/approbato.com\/blog\/#\/schema\/person\/64f139096656d0884d037457309f9c75\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/approbato.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/approbato.com\/blog\/#\/schema\/person\/64f139096656d0884d037457309f9c75\",\"name\":\"Guilherme Approbato\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/approbato.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/approbato.com\/blog\/wp-content\/uploads\/2020\/10\/guilherme-96x96.jpg\",\"contentUrl\":\"http:\/\/approbato.com\/blog\/wp-content\/uploads\/2020\/10\/guilherme-96x96.jpg\",\"caption\":\"Guilherme Approbato\"},\"logo\":{\"@id\":\"https:\/\/approbato.com\/blog\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/approbato.com\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Change colors in Qlik using variables - Guilherme Approbato","description":"Let the users change the colors of the charts using variables in Qlik Sense.","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:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/","og_locale":"en_US","og_type":"article","og_title":"Change colors in Qlik using variables - Guilherme Approbato","og_description":"Let the users change the colors of the charts using variables in Qlik Sense.","og_url":"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/","og_site_name":"Guilherme Approbato","article_published_time":"2021-01-29T21:17:35+00:00","article_modified_time":"2022-08-04T18:59:17+00:00","og_image":[{"width":1884,"height":818,"url":"http:\/\/approbato.com\/blog\/wp-content\/uploads\/2021\/01\/Thumb_Color_Video.png","type":"image\/png"}],"author":"Guilherme Approbato","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Guilherme Approbato","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/#article","isPartOf":{"@id":"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/"},"author":{"name":"Guilherme Approbato","@id":"https:\/\/approbato.com\/blog\/#\/schema\/person\/64f139096656d0884d037457309f9c75"},"headline":"Change colors in Qlik using variables","datePublished":"2021-01-29T21:17:35+00:00","dateModified":"2022-08-04T18:59:17+00:00","mainEntityOfPage":{"@id":"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/"},"wordCount":299,"commentCount":0,"publisher":{"@id":"https:\/\/approbato.com\/blog\/#\/schema\/person\/64f139096656d0884d037457309f9c75"},"keywords":["Qlik Sense","Variables"],"articleSection":["English","Qlik"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/","url":"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/","name":"Change colors in Qlik using variables - Guilherme Approbato","isPartOf":{"@id":"https:\/\/approbato.com\/blog\/#website"},"datePublished":"2021-01-29T21:17:35+00:00","dateModified":"2022-08-04T18:59:17+00:00","description":"Let the users change the colors of the charts using variables in Qlik Sense.","breadcrumb":{"@id":"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/approbato.com\/blog\/change-colors-in-qlik-using-variables\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/approbato.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Change colors in Qlik using variables"}]},{"@type":"WebSite","@id":"https:\/\/approbato.com\/blog\/#website","url":"https:\/\/approbato.com\/blog\/","name":"Guilherme Approbato","description":"Management Consulting | Certified Qlik Data Architect and Business Analyst","publisher":{"@id":"https:\/\/approbato.com\/blog\/#\/schema\/person\/64f139096656d0884d037457309f9c75"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/approbato.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/approbato.com\/blog\/#\/schema\/person\/64f139096656d0884d037457309f9c75","name":"Guilherme Approbato","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/approbato.com\/blog\/#\/schema\/person\/image\/","url":"http:\/\/approbato.com\/blog\/wp-content\/uploads\/2020\/10\/guilherme-96x96.jpg","contentUrl":"http:\/\/approbato.com\/blog\/wp-content\/uploads\/2020\/10\/guilherme-96x96.jpg","caption":"Guilherme Approbato"},"logo":{"@id":"https:\/\/approbato.com\/blog\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/approbato.com\/blog"]}]}},"_links":{"self":[{"href":"https:\/\/approbato.com\/blog\/wp-json\/wp\/v2\/posts\/110"}],"collection":[{"href":"https:\/\/approbato.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/approbato.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/approbato.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/approbato.com\/blog\/wp-json\/wp\/v2\/comments?post=110"}],"version-history":[{"count":6,"href":"https:\/\/approbato.com\/blog\/wp-json\/wp\/v2\/posts\/110\/revisions"}],"predecessor-version":[{"id":218,"href":"https:\/\/approbato.com\/blog\/wp-json\/wp\/v2\/posts\/110\/revisions\/218"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/approbato.com\/blog\/wp-json\/wp\/v2\/media\/114"}],"wp:attachment":[{"href":"https:\/\/approbato.com\/blog\/wp-json\/wp\/v2\/media?parent=110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/approbato.com\/blog\/wp-json\/wp\/v2\/categories?post=110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/approbato.com\/blog\/wp-json\/wp\/v2\/tags?post=110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}